-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
48 lines (40 loc) · 1.26 KB
/
Copy pathnginx.conf
File metadata and controls
48 lines (40 loc) · 1.26 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
events {
worker_connections 1024;
}
http {
upstream app {
server app:3000 max_fails=3 fail_timeout=30s;
keepalive 32;
}
server {
listen 80;
server_name _;
client_max_body_size 20M;
location /health {
proxy_pass http://app;
access_log off;
proxy_read_timeout 5s;
proxy_connect_timeout 5s;
}
location / {
proxy_pass http://app;
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;
proxy_set_header Connection "";
# Graceful shutdown and retry on errors
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
proxy_next_upstream_tries 2;
# Timeouts appropriate for full-text search queries
proxy_read_timeout 60s;
proxy_connect_timeout 5s;
proxy_send_timeout 30s;
}
location /_next/static {
proxy_pass http://app;
add_header Cache-Control "public, immutable";
}
}
}