File tree Expand file tree Collapse file tree 1 file changed +27
-22
lines changed Expand file tree Collapse file tree 1 file changed +27
-22
lines changed Original file line number Diff line number Diff line change 11server {
2- listen 443 ssl http2;
3- listen [::]:443 ssl http2;
4-
5- server_name _;
6-
7- root /var/www/Nginx-Example;
8-
9- index index.html;
10-
11- location / {
2+
3+ # Standard Directives
4+ listen 443 ssl http2;
5+ listen [::]:443 ssl http2;
6+ server_name _;
7+ root /var/www/Nginx-Example;
8+ index index.html;
9+ keepalive_timeout 70;
10+
11+ # TLS Directives
12+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
13+ ssl_protocols TLSv1.2 TLSv1.3;
14+ ssl_certificate /etc/nginx/ssl/_.crt;
15+ ssl_certificate_key /etc/nginx/ssl/_.key;
16+ ssl_prefer_server_ciphers on;
17+ ssl_ciphers HIGH:!aNULL:!MD5;
18+ ssl_dhparam /etc/nginx/ssl/dhparam.pem;
19+ ssl_session_cache shared:SSL:10m;
20+ ssl_session_timeout 1h;
21+
22+ # 404 error if server cant't find files in root
23+ location / {
1224 try_files $uri $uri/ =404;
1325 }
14-
15- ssl_certificate /etc/nginx/ssl/_.crt;
16- ssl_certificate_key /etc/nginx/ssl/_.key;
17- ssl_prefer_server_ciphers on;
18- ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
19- ssl_dhparam /etc/nginx/ssl/dhparam.pem;
20- ssl_session_cache shared:SSL:5m;
21- ssl_session_timeout 1h;
2226}
2327
28+ # Redirect from Port 80
2429server {
25- listen 80;
26- listen [::]:80;
27- server_name _;
28- return 301 https://$server_name$request_uri;
30+ listen 80;
31+ listen [::]:80;
32+ server_name _;
33+ return 301 https://$server_name$request_uri;
2934}
You can’t perform that action at this time.
0 commit comments