-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathnginx.conf
77 lines (65 loc) · 2.41 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
75
76
77
server {
listen 80;
listen [::]:80;
# Change port to 443 and do the nginx ssl stuff if you want it.
# Change server name to the HTTP hostname you are using.
# You may also make this the default server by listening with default_server,
# if you disable the default nginx server declared.
server_name <hostname>;
add_header X-UA-Compatible "IE=Edge,chrome=1";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
charset utf-8;
try_files $uri @icons;
error_page 502 504 /502.html;
location ~ ^/502\.html$|^/logo\.png$|^/robots\.txt$ {
root <site code path>;
}
location @icons {
root <site code path>/resources/icons;
error_page 403 = @uwsgi;
error_page 404 = @uwsgi;
}
location @uwsgi {
uwsgi_read_timeout 600;
# Change this path if you did so in uwsgi.ini
uwsgi_pass unix:///tmp/dmoj-site.sock;
include uwsgi_params;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
}
location /static {
gzip_static on;
expires max;
root <django setting STATIC_ROOT, without the final /static>;
# Comment out root, and use the following if it doesn't end in /static.
#alias <STATIC_ROOT>;
}
# Uncomment if you are using PDFs and want to serve it faster.
# This location name should be set to DMOJ_PDF_PROBLEM_INTERNAL.
#location /pdfcache {
# internal;
# root <the value of DMOJ_PDF_PROBLEM_CACHE in local_settings.py>;
# # Default from docs:
# #root /home/dmoj-uwsgi/;
#}
# Uncomment if you are allowing user data downloads and want to serve it faster.
# This location name should be set to DMOJ_USER_DATA_INTERNAL.
#location /datacache {
# internal;
# root <path to data cache directory, without the final /datacache>;
# # Default from docs:
# #root /home/dmoj-uwsgi/;
#}
# Uncomment these sections if you are using the event server.
#location /event/ {
# proxy_pass http://127.0.0.1:<event server websocket port>/;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_read_timeout 86400;
#}
#location /channels/ {
# proxy_read_timeout 120;
# proxy_pass http://127.0.0.1:<event server http port>;
#}
}