-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
27 lines (25 loc) · 1 KB
/
Copy pathnginx.conf
File metadata and controls
27 lines (25 loc) · 1 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
server {
listen $PORT;
server_name localhost;
# Serve the React SPA static files.
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
# Proxy all /api/ requests to the internal backend Cloud Run service.
# The trailing slash on proxy_pass strips the /api prefix before forwarding,
# so /api/query/execute becomes /query/execute on the backend.
# BACKEND_URL is injected at container startup via docker-entrypoint.sh.
location /api/ {
proxy_pass $BACKEND_URL/;
proxy_http_version 1.1;
proxy_set_header Host $proxy_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 $http_x_forwarded_proto;
proxy_read_timeout 300s;
proxy_connect_timeout 10s;
proxy_send_timeout 300s;
}
}