42 lines
1.5 KiB
Nginx Configuration File
42 lines
1.5 KiB
Nginx Configuration File
# SPA host for ac-ui. Serves the static bundle with a React-Router fallback and
|
|
# reverse-proxies the API (/api) + management (/q) endpoints to ac-code-server, so the
|
|
# browser only ever talks to this single origin (no CORS). Mirrors the Vite dev proxy.
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Docker's embedded DNS; re-resolve so a recreated ac-code-server container
|
|
# (new IP after the 'compose rm -f' inside manage-ac.sh deploy) is picked up
|
|
# without restarting nginx.
|
|
resolver 127.0.0.11 valid=10s;
|
|
|
|
# SPA deep-links: serve real files, otherwise fall back to index.html.
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /api/ {
|
|
set $upstream http://ac-code-server:8787;
|
|
proxy_pass $upstream$request_uri;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
# A whole-project deep "ingest all" runs for minutes; don't let the proxy cut it at the
|
|
# default 60s. The server is synchronous, so give the response ample time to return.
|
|
proxy_read_timeout 1800s;
|
|
proxy_send_timeout 1800s;
|
|
}
|
|
|
|
location /q/ {
|
|
set $upstream http://ac-code-server:8787;
|
|
proxy_pass $upstream$request_uri;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|