aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-05-19 19:17:28 -0700
committerbnewbold <bnewbold@robocracy.org>2016-05-19 19:18:00 -0700
commit6888a887f03cda1155f6d8faaab67f512bbb01c8 (patch)
tree95d406cafd68157db1bc73ad5434b4027dac0986 /roles
parent5e4dbc5bbd09427791bdaf43c6b459f5b0a4f945 (diff)
downloadinfra-6888a887f03cda1155f6d8faaab67f512bbb01c8.tar.gz
infra-6888a887f03cda1155f6d8faaab67f512bbb01c8.zip
nginx: add reverse proxy and ssl directions
Diffstat (limited to 'roles')
-rw-r--r--roles/nginx/HOWTO_new_site.txt33
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";
+