Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name example.com;
- return 301 https://example.com$request_uri;
- root /path/to/example.com/docroot;
- index index.php;
- access_log /var/log/nginx/example.com-access.log;
- error_log /var/log/nginx/example.com-error.log;
- location / {
- try_files $uri $uri/ /index.php?q=$uri&$args;
- }
- location ~ /.well-known {
- auth_basic off;
- allow all;
- }
- location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
- deny all;
- }
- location ~ ^/(config|temp|logs)/ {
- deny all;
- }
- location ~ /\. {
- deny all;
- access_log off;
- log_not_found off;
- }
- location ~ \.php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_intercept_errors on;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 256 4k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- }
- }
- server {
- listen 443 ssl http2;
- server_name example.com;
- root /path/to/example.com/docroot;
- index index.php;
- access_log /var/log/nginx/example.com-access.log;
- error_log /var/log/nginx/example.com-error.log;
- location / {
- try_files $uri $uri/ /index.php?q=$uri&$args;
- }
- location ~ /.well-known {
- auth_basic off;
- allow all;
- }
- location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
- deny all;
- }
- location ~ ^/(config|temp|logs)/ {
- deny all;
- }
- location ~ /\. {
- deny all;
- access_log off;
- log_not_found off;
- }
- location ~ \.php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_intercept_errors on;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 256 4k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- }
- ssl on;
- ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
- ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_prefer_server_ciphers on;
- ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:!DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
- # https://weakdh.org/
- # openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
- ssl_dhparam /etc/nginx/ssl/dhparam.pem;
- # https://trac.nginx.org/nginx/ticket/235
- # nginx vs openssl segfault error, workaround is to be configured at the http{} block level.
- # ssl_session_cache shared:SSL:50m;
- ssl_session_timeout 60m;
- ssl_stapling on;
- ssl_stapling_verify on;
- resolver 8.8.8.8 8.8.4.4 valid=86400s;
- resolver_timeout 10s;
- add_header Strict-Transport-Security "max-age=31536000; preload";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement