forked from ericwbailey/empathy-prompts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
openforwhom_nginx
41 lines (34 loc) · 1.05 KB
/
openforwhom_nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# REDIRECTS - EVERYTHING TO HTTPS AND NO WWW
server {
listen 80;
server_name openforwhom.org *.openforwhom.org;
return 301 https://openforwhom.org$request_uri;
}
server {
listen 443;
server_name www.openforwhom.org;
return 301 https://openforwhom.org;
}
server {
listen 443;
server_name openforwhom.org;
root /home/cloo/live/openresearchbutton/openforwhom/docs;
rewrite ^/(.*)/$ /$1 permanent;
ssl on;
ssl_certificate /etc/letsencrypt/live/openforwhom.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/openforwhom.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
ssl_stapling on;
add_header Strict-Transport-Security "max-age=31536000;";
add_header Pragma public;
add_header Cache-Control "public";
add_header Access-Control-Allow-Origin *;
location = / {
# don't do the try_files on the root with trailing slash as causes issues with /#thing
}
location / {
try_files $uri $uri.html $uri/index.html =404;
}
}