This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| snippets:nginx [2014/11/12 16:53] – created allspark | snippets:nginx [2016/09/29 14:38] (current) – allspark_cp | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ## SSL | ||
| + | |||
| ``` | ``` | ||
| ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
| ssl_ciphers ECDH+AESGCM: | ssl_ciphers ECDH+AESGCM: | ||
| ssl_prefer_server_ciphers on; | ssl_prefer_server_ciphers on; | ||
| + | ``` | ||
| + | |||
| + | ## proxy | ||
| + | |||
| + | ``` | ||
| + | proxy_pass http:// | ||
| + | proxy_set_header Host $host; | ||
| + | proxy_set_header X-Forwarded-Proto $scheme; | ||
| + | proxy_set_header X-Real-IP $remote_addr; | ||
| + | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| + | proxy_set_header Proxy ""; | ||
| + | proxy_redirect off; | ||
| + | proxy_connect_timeout 30; | ||
| + | proxy_buffering off; | ||
| + | proxy_request_buffering off; | ||
| + | | ||
| + | # for websockets | ||
| + | proxy_http_version 1.1; | ||
| + | proxy_set_header Upgrade $http_upgrade; | ||
| + | proxy_set_header Connection " | ||
| + | proxy_read_timeout 10m; | ||
| + | proxy_send_timeout 10m; | ||
| + | ``` | ||
| + | |||
| + | ## example | ||
| + | |||
| + | ``` | ||
| + | server { | ||
| + | listen 443 ssl http2; | ||
| + | listen [::]:443 ssl http2; | ||
| + | server_name mirror.wormhole.eu; | ||
| + | |||
| + | root /srv/ftp; | ||
| + | |||
| + | ssl on; | ||
| + | ssl_certificate / | ||
| + | ssl_certificate_key / | ||
| + | |||
| + | ssl_session_timeout 5m; | ||
| + | |||
| + | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
| + | ssl_ciphers ECDH+AESGCM: | ||
| + | ssl_prefer_server_ciphers on; | ||
| + | |||
| + | ssl_stapling on; | ||
| + | ssl_stapling_verify on; | ||
| + | ssl_trusted_certificate / | ||
| + | ssl_session_cache shared: | ||
| + | |||
| + | add_header Strict-Transport-Security " | ||
| + | |||
| + | |||
| + | ssl_dhparam / | ||
| + | |||
| + | location / { | ||
| + | try_files $uri $uri/ =404; | ||
| + | autoindex on; | ||
| + | | ||
| + | expires -1; | ||
| + | } | ||
| + | } | ||
| ``` | ``` | ||