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 ; 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 ; } location @icons { root /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 ; # Comment out root, and use the following if it doesn't end in /static. #alias ; } # 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 ; # # 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 ; # # 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:/; # 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:; #} }