41 lines
1.1 KiB
Nginx Configuration File
41 lines
1.1 KiB
Nginx Configuration File
events {
|
||
worker_connections 1024;
|
||
}
|
||
|
||
http {
|
||
include mime.types;
|
||
server {
|
||
listen 80;
|
||
server_name localhost;
|
||
|
||
proxy_connect_timeout 5s;
|
||
proxy_send_timeout 5s;
|
||
proxy_read_timeout 5s;
|
||
|
||
location / {
|
||
root /frontend-dist;
|
||
index index.html;
|
||
expires 30d;
|
||
add_header Cache-Control "public, immutable";
|
||
access_log off;
|
||
}
|
||
|
||
location /api/ {
|
||
proxy_pass http://polyphonia-binary-server:3000;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
|
||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||
root /frontend-dist; # Files will be read from /frontend-dist$uri
|
||
try_files $uri =404; # Don’t fall back to upstream if missing
|
||
expires 30d;
|
||
add_header Cache-Control "public, immutable";
|
||
access_log off;
|
||
}
|
||
}
|
||
}
|