mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fcb958c5c0
- Commented out by default - No functional change unless code is un-commented in the docker-compose script
58 lines
1.4 KiB
Plaintext
58 lines
1.4 KiB
Plaintext
|
|
server {
|
|
|
|
# Listen for connection on (internal) port 80
|
|
listen 80;
|
|
|
|
location / {
|
|
# Change 'inventree-dev-server' to the name of the inventree server container,
|
|
# and '8000' to the INVENTREE_WEB_PORT (if not default)
|
|
proxy_pass http://inventree-dev-server:8000;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_redirect off;
|
|
|
|
client_max_body_size 100M;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
|
|
}
|
|
|
|
# Redirect any requests for static files
|
|
location /static/ {
|
|
alias /var/www/dev/static/;
|
|
autoindex on;
|
|
|
|
# Caching settings
|
|
expires 30d;
|
|
add_header Pragma public;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
# Redirect any requests for media files
|
|
location /media/ {
|
|
alias /var/www/dev/media/;
|
|
|
|
# Media files require user authentication
|
|
auth_request /auth;
|
|
}
|
|
|
|
# Use the 'user' API endpoint for auth
|
|
location /auth {
|
|
internal;
|
|
|
|
proxy_pass http://inventree-dev-server:8000/auth/;
|
|
|
|
proxy_pass_request_body off;
|
|
proxy_set_header Content-Length "";
|
|
proxy_set_header X-Original-URI $request_uri;
|
|
}
|
|
|
|
}
|