diff options
Diffstat (limited to 'roles/nginx')
-rw-r--r-- | roles/nginx/HOWTO_new_site.txt | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/roles/nginx/HOWTO_new_site.txt b/roles/nginx/HOWTO_new_site.txt index ef9ee37..0989efd 100644 --- a/roles/nginx/HOWTO_new_site.txt +++ b/roles/nginx/HOWTO_new_site.txt @@ -16,4 +16,35 @@ For a static website: For a reverse proxied website: - XXX: TODO + server { + listen 80; + listen [::]:80; + server_name <example.com>; + + location /theme_static/ { + alias /some/static/files/dir/theme_static/; + } + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://127.0.0.1:<localport>; + } + } + +For SSL stuff, add this to the body: + + listen 443 ssl spdy; + listen [::]:443 ssl spdy; + + ssl_certificate /etc/letsencrypt/live/<cert-name>/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/<cert-name>/privkey.pem; + + add_header Content-Security-Policy "default-src 'self'"; + add_header X-Frame-Options "SAMEORIGIN"; # 'always' if nginx > 1.7.5 + add_header X-Content-Type-Options "nosniff"; # 'always' if nginx > 1.7.5 + add_header X-Xss-Protection "1"; + # Enable STS with one year period (breaks http; optional) + #add_header Strict-Transport-Security "max-age=31557600; includeSubDomains"; + |