Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
BinAccel Create nginx.conf 1c558ea Mar 1, 2017
0 contributors

Users who have contributed to this file

66 lines (54 sloc) 1.95 KB
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;
}
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 PROBLEM_PDF_INTERNAL.
#location /pdfcache {
# internal;
# root <path to pdf cache diretory, without the final /pdfcache>;
#}
# 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>;
#}
}
You can’t perform that action at this time.