2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 01:55:39 +00:00
Oliver Walters
2021-06-16 21:30:25 +10:00
parent 058fc57ff1
commit acd7322ff0
3 changed files with 31 additions and 6 deletions

View File

@ -1,3 +1,4 @@
server {
# Listen for connection on (internal) port 80
@ -37,12 +38,20 @@ server {
# Redirect any requests for media files
location /media/ {
alias /var/www/media/;
autoindex on;
# Caching settings
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
# Media files require user authentication
auth_request /auth;
}
# Use the 'user' API endpoint for auth
location /auth {
internal;
proxy_pass http://inventree-server:8000/auth/;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
}