diff --git a/dmoj/nginx/nginx.conf b/dmoj/nginx/nginx.conf index cdf4b0f..7301903 100644 --- a/dmoj/nginx/nginx.conf +++ b/dmoj/nginx/nginx.conf @@ -3,15 +3,16 @@ events { worker_connections 1024; } http { + include mime.types; # Logging - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /dev/stdout main; + access_log /dev/stdout main; server { @@ -28,12 +29,13 @@ http { } server { - resolver 127.0.0.11 valid=10s; - resolver_timeout 5s; + + resolver 127.0.0.11 valid=10s; + resolver_timeout 5s; listen 443 ssl; listen [::]:443 ssl; - http2 on; + http2 on; server_name mcpt.ca; @@ -84,12 +86,13 @@ http { } location @uwsgi { - # see https://stackoverflow.com/a/56487286/18516611 - set $target_host site; + + # see https://stackoverflow.com/a/56487286/18516611 + set $target_host site; uwsgi_read_timeout 600; uwsgi_pass $target_host:8000; include uwsgi_params; - uwsgi_param HTTP_HOST $server_name; + uwsgi_param HTTP_HOST $server_name; uwsgi_param SERVER_SOFTWARE nginx/$nginx_version; } @@ -101,13 +104,15 @@ http { } location /media { - expires @24h; + + expires @24h; alias /media/; } location /pdfcache { + internal; - expires @24h; + expires @24h; root /; } @@ -122,7 +127,7 @@ http { default_type image/svg+xml; alias /mathoid; access_log off; - expires 30d; + expires 30d; add_header Cache-Control "max-age=2592000, public"; # 30 days } @@ -132,12 +137,13 @@ http { default_type image/svg+xml; alias /texoid; access_log off; - expires 30d; - add_header Cache-Control "max-age=2592000, public"; # 30 days + expires 30d; + add_header Cache-Control "max-age=2592000, public"; # 30 days } location /event/ { - set $event_host wsevent; + + set $event_host wsevent; proxy_pass http://$event_host:15100/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -146,10 +152,11 @@ http { } location /channels/ { - set $channels_host wsevent; + + set $channels_host wsevent; proxy_read_timeout 120; proxy_pass http://$channels_host:15102/; } } -} \ No newline at end of file +}