mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-05 13:15:18 +02:00
fix: update NGINX configuration and docker-compose for improved service referencing and clarity
This commit is contained in:
parent
1e48152e1a
commit
b1a3379604
2 changed files with 7 additions and 8 deletions
|
@ -1,5 +1,4 @@
|
|||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
@ -13,29 +12,29 @@ http {
|
|||
|
||||
client_max_body_size 100M;
|
||||
|
||||
# The backend is running in the same container, so reference localhost
|
||||
upstream django {
|
||||
server 127.0.0.1:8000; # Use localhost to point to Gunicorn running internally
|
||||
server server:8000; # Use the internal Docker networking
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80; # NGINX listens on port 80 inside the container
|
||||
listen 80; # NGINX always listens on port 80 inside the container
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
proxy_pass http://django; # Forward to the upstream block
|
||||
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
|
||||
alias /code/media/; # Serve media files directly
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue