2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 17:10:29 +01:00
website/build/proxy/nginx.conf

47 lines
901 B
Nginx Configuration File
Raw Normal View History

2019-09-04 20:50:53 +02:00
events {}
http {
2019-09-05 11:18:42 +02:00
gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
2019-09-04 20:50:53 +02:00
2019-09-05 11:18:42 +02:00
include mime.types;
2019-09-04 20:50:53 +02:00
upstream server {
server server:3000;
}
map $request_uri $expires {
default off;
"~-[0-9a-z]{10}\.js$" 365d;
"~*(woff|woff2|ttf|eot)$" 365d;
}
2019-09-12 20:46:01 +02:00
map $sent_http_content_type $csp {
default "";
"~^text/html" "default-src 'self'; style-src 'self' 'unsafe-inline'";
}
2019-09-04 20:50:53 +02:00
server {
listen 80;
autoindex on;
root /www/data;
expires $expires;
2019-09-12 20:46:01 +02:00
add_header Content-Security-Policy $csp;
2019-09-13 08:42:22 +02:00
add_header Strict-Transport-Security 'max-age=604800; includeSubDomains';
2019-09-04 20:50:53 +02:00
location /api/ {
proxy_pass http://server;
proxy_redirect off;
rewrite ^/api(.*)$ $1 break;
2019-09-05 11:18:42 +02:00
proxy_hide_header Content-Type;
add_header Content-Type "application/json";
}
location /auditorium/ {
try_files $uri $uri/ /auditorium/index.html;
2019-09-04 20:50:53 +02:00
}
}
}