From bd2873868626c776f8aaf9579cb78916bc67dcd5 Mon Sep 17 00:00:00 2001 From: Redume Date: Fri, 18 Oct 2024 22:24:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=84=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/nginx.conf b/nginx.conf index b5202ac..9aa64dc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,30 +1,31 @@ -server { - listen 80 default_server; - listen [::]:80 default_server; - server_name example.com +events { } - location / { - return 301 https://$host$request_uri; +http { + server { + listen 80 default_server; + listen [::]:80 default_server; + server_name example.com; + + location / { + return 301 https://$host$request_uri; + } } -} -server { - listen 443 ssl; - listen [::]:443 ssl; - http2 on; - server_name example.com + server { + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + server_name example.com; - ssl_certificate /etc/nginx/ssl/fullchain.pem; - ssl_certificate_key /etc/nginx/ssl/privkey.pem; - ssl_session_timeout 1d; - ssl_session_cache shared:MozSSL:10m; # about 40000 sessions + ssl_certificate /etc/nginx/ssl/fullchain.pem; + ssl_certificate_key /etc/nginx/ssl/privkey.pem; + ssl_session_timeout 1d; + ssl_session_cache shared:MozSSL:10m; - # modern configuration - ssl_protocols TLSv1.3; - ssl_prefer_server_ciphers off; + ssl_protocols TLSv1.3; + ssl_prefer_server_ciphers off; - # HSTS (ngx_http_headers_module is required) (63072000 seconds) - add_header Strict-Transport-Security "max-age=63072000" always; + add_header Strict-Transport-Security "max-age=63072000" always; - # replace with the IP address of your resolver + } } \ No newline at end of file