From 6888a887f03cda1155f6d8faaab67f512bbb01c8 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 19 May 2016 19:17:28 -0700 Subject: nginx: add reverse proxy and ssl directions --- roles/nginx/HOWTO_new_site.txt | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'roles') 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 ; + + 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:; + } + } + +For SSL stuff, add this to the body: + + listen 443 ssl spdy; + listen [::]:443 ssl spdy; + + ssl_certificate /etc/letsencrypt/live//fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live//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"; + -- cgit v1.2.3