Files
agent_alpha/frontend/nginx.conf
T
furyhawk 58a41093c6 feat(auth): implement authentication API with login, register, and token management
- Added token management functions in frontend API for storing and retrieving auth tokens.
- Created authentication routes in backend for user registration, login, and profile retrieval.
- Implemented JWT token creation and validation for secure user sessions.
- Updated frontend API calls to include authorization headers for protected routes.
- Added bcrypt dependency for password hashing in user registration.
2026-06-12 21:37:45 +08:00

30 lines
1.1 KiB
Nginx Configuration File

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# ── API proxy ─────────────────────────────────────────────────
# Container runtime (Docker/Podman) resolves backend:8000 via
# its built-in DNS. nginx caches the resolved IP at startup, so
# restarting the backend container needs a frontend restart too.
location /api/ {
proxy_pass http://backend:8000;
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_connect_timeout 30s;
proxy_read_timeout 200s;
proxy_send_timeout 200s;
}
# ── Static files ──────────────────────────────────────────────
location / {
try_files $uri $uri/ /index.html;
expires 1y;
add_header Cache-Control "public, immutable";
}
}