/
nginx.conf
74 lines (63 loc) · 2.49 KB
/
nginx.conf
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
upstream django {
keepalive 600;
server 127.0.0.1:8000;
}
server {
listen 80;
listen [::]:80;
server_name xrmass.org *.xrmass.org;
location /.well-known/ {
root /home/www/xrmass.org;
}
location / {
rewrite ^ https://$http_host$request_uri? permanent;
}
}
server {
server_name xrmass.org *.xrmass.org;
listen 443 ssl http2;
listen [::]:443 ssl http2; ## listen for ipv6
ssl on;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_dhparam /etc/nginx/dhparam.pem;
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 1d;
ssl_session_tickets off;
keepalive_timeout 1200;
ssl_certificate /etc/letsencrypt/live/xrmass.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/xrmass.org/privkey.pem;
server_name_in_redirect off;
root /home/src/xrmass.org/static_root/;
# expires 1h;
index index.html;
access_log /var/log/nginx/xrmass_access.log;
resolver 1.1.1.1;
add_header X-Frame-Options DENY;
add_header Alternate-Protocol 443:npn-spdy/3;
location /favicon.ico {
root /home/www/xrmass.org/;
}
location /static {
expires 14d;
add_header Access-Control-Allow-Origin *;
add_header Strict-Transport-Security "max-age=31536000;";
alias /home/www/xrmass.org;
}
location / {
gzip_proxied any;
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
add_header Strict-Transport-Security "max-age=31536000;";
client_max_body_size 20m;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Scheme $scheme;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_redirect off;
proxy_pass http://django;
}
}