2024-10-25 22:57:10 -04:00
|
|
|
worker_processes 1;
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
2024-12-01 09:52:34 -05:00
|
|
|
client_max_body_size 100M;
|
|
|
|
|
2024-10-25 22:57:10 -04:00
|
|
|
upstream django {
|
|
|
|
server server:8000; # Use the internal Docker networking
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80; # NGINX always listens on port 80 inside the container
|
|
|
|
server_name localhost;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_pass http://server:8000; # Explicitly forward to Django service
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
location /static/ {
|
|
|
|
alias /code/staticfiles/; # Serve static files directly
|
|
|
|
}
|
|
|
|
|
|
|
|
location /media/ {
|
|
|
|
alias /code/media/; # Serve media files directly
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|