-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
60 lines (48 loc) · 1.31 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
server {
listen 80;
listen [::]:80;
server_name rvgunnerus.no;
return 301 https://$host$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name www.rvgunnerus.no;
return 301 https://rvgunnerus.no;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name rvgunnerus.no;
root /srv/reserver/gunnerus/;
ssl on;
ssl_certificate /home/reserver/rvgunnerus_no.crt;
ssl_certificate_key /home/reserver/private-server-ssl.key;
# config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
# to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
# add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;
error_page 503 /under_maintenance.html;
location = /under_maintenance.html {
internal;
root $document_root;
}
location /uploads/ {
autoindex on;
alias $document_root/uploads/;
}
location /static/ {
autoindex on;
expires 1h;
alias $document_root/collected_static/;
}
location /favicon.ico {
alias $document_root/collected_static/reserver/favicon.ico;
}
location / {
if (-f $document_root/maintenance_mode.on) {
return 503;
}
proxy_pass http://unix:/run/reserver.sock; # change to the host/port the server is listening on.
proxy_set_header Host $host;
}
}