|
| 1 | + |
| 2 | +server { |
| 3 | + listen 443 ssl http2 default_server; |
| 4 | + listen [::]:443 ssl http2 default_server; |
| 5 | + root $NGINX_WEB_ROOT; |
| 6 | +
|
| 7 | + location / { |
| 8 | + try_files $uri $NGINX_PHP_FALLBACK$is_args$args; |
| 9 | + } |
| 10 | + location ~ $NGINX_PHP_LOCATION { |
| 11 | + fastcgi_pass unix:$PHP_SOCK_FILE; |
| 12 | + fastcgi_split_path_info ^(.+\.php)(/.*)$; |
| 13 | + include fastcgi_params; |
| 14 | + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; |
| 15 | + fastcgi_param DOCUMENT_ROOT $realpath_root; |
| 16 | +
|
| 17 | + internal; |
| 18 | + } |
| 19 | + |
| 20 | + # return 404 for all other php files not matching the front controller |
| 21 | + # this prevents access to other php files you don't want to be accessible. |
| 22 | + location ~ \.php$ { |
| 23 | + return 404; |
| 24 | + } |
| 25 | + |
| 26 | + ssl_certificate $NGINX_SSL_PUBLIC_CERTIFICATE; |
| 27 | + ssl_certificate_key $NGINX_SSL_PRIVATE_CERTIFICATE; |
| 28 | + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 29 | + ssl_prefer_server_ciphers on; |
| 30 | + ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; |
| 31 | + ssl_ecdh_curve secp384r1; |
| 32 | + ssl_session_cache shared:SSL:10m; |
| 33 | + ssl_session_tickets off; |
| 34 | + ssl_stapling on; |
| 35 | + ssl_stapling_verify on; |
| 36 | + resolver 8.8.8.8 8.8.4.4 valid=300s; |
| 37 | + resolver_timeout 5s; |
| 38 | + # Disable preloading HSTS for now. You can use the commented out header line that includes |
| 39 | + # the "preload" directive if you understand the implications. |
| 40 | + #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; |
| 41 | + add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; |
| 42 | + add_header X-Frame-Options DENY; |
| 43 | + add_header X-Content-Type-Options nosniff; |
| 44 | +} |
0 commit comments