register and sign in pages

This commit is contained in:
2026-09-22 00:50:30 +05:00
parent f313867653
commit 78d04f75d1
96 changed files with 6383 additions and 109 deletions
+27 -18
View File
@@ -1,17 +1,27 @@
upstream frontend { server frontend:3000; }
upstream backend { server backend:5000; }
upstream backend { server backend:5000; }
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
access_log /dev/stdout;
error_log /dev/stderr;
# Matches the frontend's serverActions bodySizeLimit (20mb).
client_max_body_size 20M;
# --- Django admin + its static assets (served by WhiteNoise from gunicorn) ---
# --- Django: API, admin, its static assets ---
location /api/ {
proxy_pass http://backend;
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_read_timeout 60s;
}
location /admin/ {
proxy_pass http://backend;
proxy_set_header Host $host;
@@ -19,31 +29,30 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Django's own static files (admin, DRF, swagger) via WhiteNoise.
location /static/ {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
# --- Django-uploaded media (written to the shared `media` volume) ---
# --- user uploads, from the shared `media` volume ---
location /media/ {
alias /app/media/;
access_log off;
}
# --- Next.js app (everything else, including its own /api/* route handlers) ---
# The browser only ever talks to Next.js; Next.js reaches Django server-side
# over the compose network via SARLINK_API_BASE_URL=http://backend:5000.
# --- the SPA ---
# Hashed bundles are immutable; the entry document must never be cached,
# or a deploy leaves browsers asking for chunks that no longer exist.
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
location / {
proxy_pass http://frontend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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;
# Honour the X-Accel-Buffering: no header the app sets for streamed responses.
proxy_buffering off;
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}
}