-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
46 lines (37 loc) · 1.17 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types; # Include MIME types
default_type application/octet-stream; # Fallback default MIME type
server {
listen 80;
server_name localhost;
root /frontend/dist;
location / {
try_files $uri /index.html;
}
location /api/ {
proxy_pass http://localhost:1323;
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;
}
# Serve CSS files with the correct MIME type
location ~ \.css$ {
add_header Content-Type text/css;
}
# Serve JavaScript files with the correct MIME type
location ~ \.js$ {
add_header Content-Type application/javascript;
}
# Optional: Cache control for static files
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg)$ {
expires 6M;
access_log off;
add_header Cache-Control "public";
}
}
}