Skip to content

Commit

Permalink
Reverted nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Inge Arvesen Folland committed Mar 20, 2025
1 parent 143efa5 commit bc6c502
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
user nginx;
worker_processes auto;
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
keepalive_timeout 65;

server {
listen 80;
server_name localhost;

# Route to frontend
location / {
proxy_pass http://frontend:3000; # Docker resolves "frontend" to the correct container
proxy_set_header Host $host;
proxy_pass http://frontend:3000;
proxy_set_header Host $http_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;
}

# Route to backend
location /api/ {
proxy_pass http://backend:8000; # Docker resolves "backend" to the correct container
proxy_set_header Host $host;
proxy_pass http://backend:8000;
proxy_set_header Host $http_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 /admin/ {
proxy_pass http://backend:8000;
proxy_set_header Host $http_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/admin/ {
proxy_pass http://backend:8000;
proxy_set_header Host $http_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;
Expand Down

0 comments on commit bc6c502

Please sign in to comment.