-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf-sample
More file actions
51 lines (45 loc) · 2.26 KB
/
Copy pathnginx.conf-sample
File metadata and controls
51 lines (45 loc) · 2.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
49
50
51
# Pyxis — sample Nginx reverse proxy (HTTP only, port 80)
# Copy to /etc/nginx/sites-available/pyxis and symlink to sites-enabled/
# Replace YOUR_SERVER_IP with your actual IP or domain.
server {
listen 80;
server_name YOUR_SERVER_IP;
# ── Frontend (Vite dev server on :5173) ──────────────────────────────────
location / {
proxy_pass http://127.0.0.1:5173;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
# ── API (FastAPI on :8000) ────────────────────────────────────────────────
location /api/ {
proxy_pass http://127.0.0.1:8000;
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_read_timeout 120s;
}
# ── WebSocket (FastAPI on :8000) ──────────────────────────────────────────
location /ws/ {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 3600s;
}
# ── Install endpoint ──────────────────────────────────────────────────────
location /install {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
# ── API docs ──────────────────────────────────────────────────────────────
location /docs {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
}