41 lines
910 B
Nginx Configuration File
41 lines
910 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
access_log /dev/stdout;
|
|
error_log /dev/stderr warn;
|
|
|
|
gzip on;
|
|
gzip_comp_level 5;
|
|
gzip_min_length 1024;
|
|
gzip_types
|
|
application/javascript
|
|
application/json
|
|
image/svg+xml
|
|
text/css
|
|
text/plain;
|
|
|
|
location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|ico|svg|webp|woff2?)$ {
|
|
access_log off;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~ ^/(analytics|auth|strava)(/|$) {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_pass http://127.0.0.1:3000;
|
|
}
|
|
|
|
location / {
|
|
add_header Cache-Control "no-store";
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|