-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
32 lines (25 loc) · 767 Bytes
/
nginx.conf
File metadata and controls
32 lines (25 loc) · 767 Bytes
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
server {
listen 3000;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Serve static files directly
location / {
try_files $uri $uri/ /index.html;
# This fallback to index.html is critical to support React Router
}
# Optional: cache static assets for performance
location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot|otf|json)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# Optional: disable .htaccess and hidden files access
location ~ /\. {
deny all;
}
error_page 404 /index.html;
# Log files location (can customize)
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}