32 lines
810 B
Nginx Configuration File
32 lines
810 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
location /api/ {
|
|
proxy_pass http://backend:3000/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location ~* \.(?:js|css|png|jpg|jpeg|svg|woff2?)$ {
|
|
expires 7d;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
# Never cache the service worker or manifest so updates roll out immediately
|
|
location = /sw.js {
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
location = /manifest.webmanifest {
|
|
default_type application/manifest+json;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
}
|