Jump to content

Simple Machines Forum на Entware


Recommended Posts

Скрытый текст

user nobody;
worker_processes  1;

error_log  /opt/var/log/nginx/error.log;

pid        /opt/var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    access_log  /opt/var/log/nginx/access.log;

    client_body_buffer_size         1K;
    client_max_body_size            6M;
    client_header_buffer_size       1k;
    large_client_header_buffers  2  1k;
    sendfile       on;
    server_tokens  off;

    client_body_timeout    10;
    client_header_timeout  10;
    keepalive_timeout      65;
    send_timeout           10;

    gzip  on;
### перенаправить ip в domen
    server {
        listen       80;
        #listen  [::]:80;
        server_name  000.00.00.000;
             return  301  https://domen name$request_uri;
        }
### закрыть доступ к ip
    server {
        listen       446  ssl  http2;
        #listen  [::]:446  ssl  http2;
        server_name  _;
            include  ssl.conf;
             return  444;
        }
### окрыть доступ в domen
    server {
        listen       446  ssl  http2;
        #listen  [::]:446  ssl  http2;
        server_name  domen name;
               root  /opt/share/nginx/html;
              index  index.php index.html index.htm;
            include  ssl.conf;
           resolver  1.1.1.1  1.0.0.1;

        charset  utf-8;
### для ошибок
        location ~ /errors {
            internal;
        }
### ошибки
        error_page  403              /errors/403.html;
        error_page  404              /errors/404.html;
        error_page  500 502 503 504  /errors/50x.html;
### когда нет папки или файла отдать 404
        location / {
            try_files  $uri  $uri/ =404;
        }
### отдать средствами сервера
        location ~* \.(js|css|gdf|ttf|ico|svg)$ {
            log_not_found  off;
            access_log     off;
        }
### когда нет файла отдать 404
        location ~ \.php$ {
            try_files      $uri =404;
            fastcgi_index  index.php;
            fastcgi_pass   unix:/opt/var/run/php8-fpm/php8-fpm.sock;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
### досту всем для сертификации
        location ~ /\.well-known {
            try_files  $uri =404;
            allow      all;
        }
### защитить скрытые файлы
        location ~ /\. {
            return  403;
            deny    all;
            allow   192.168.1.0/24;
        }
    }

}

 

сделал вот такой конфиг.  скорее не правильный. но как мог. всё когда то  начинается. буду счастлив любым подсказкам.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...