Skip to content

Commit

Permalink
config: Update nginx configuration to proxy requests to Django app
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Feb 7, 2024
1 parent 001ccbd commit 48ab2da
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nginx/custom-nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ server {
alias /nginx/upload/;
}

# Proxy other /server/* requests to the Django app
# Serve files from /test-path/ from the /nginx/static/ directory
location /test-path/ {
alias /nginx/static/;
}

# Proxy other /server/* requests to the Django app that runs on http://localhost:8000
location /server/ {
rewrite ^/server(/.*)$ $1 break;
proxy: [http://localhost:8000](http://localhost:8000 "http://localhost:8000/");
proxy_pass http://localhost: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;
}
}

0 comments on commit 48ab2da

Please sign in to comment.