-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathnginx.conf
More file actions
34 lines (30 loc) · 1.03 KB
/
nginx.conf
File metadata and controls
34 lines (30 loc) · 1.03 KB
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
server {
listen 80;
# Basic authentication (AUTH_BASIC_SETTING replaced by docker-entrypoint.sh)
auth_basic AUTH_BASIC_SETTING;
auth_basic_user_file /etc/nginx/.htpasswd;
server_name localhost;
# Allow larger request bodies (up to 10MB)
client_max_body_size 10M;
# Serve static files
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
# Proxy API requests to Node.js backend
location /api/ {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
# Allow larger bodies for API requests
client_max_body_size 10M;
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
}
}