You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.3 KiB

  1. server {
  2. # Listen for connection on (internal) port 80
  3. listen 80;
  4. location / {
  5. # Change 'inventree-server' to the name of the inventree server container,
  6. # and '8000' to the INVENTREE_WEB_PORT (if not default)
  7. proxy_pass http://inventree-server:8000;
  8. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  9. proxy_set_header Host $http_host;
  10. proxy_redirect off;
  11. client_max_body_size 100M;
  12. proxy_set_header X-Real-IP $remote_addr;
  13. proxy_set_header X-Forwarded-Proto $scheme;
  14. proxy_buffering off;
  15. proxy_request_buffering off;
  16. }
  17. # Redirect any requests for static files
  18. location /static/ {
  19. alias /var/www/static/;
  20. autoindex on;
  21. # Caching settings
  22. expires 30d;
  23. add_header Pragma public;
  24. add_header Cache-Control "public";
  25. }
  26. # Redirect any requests for media files
  27. location /media/ {
  28. alias /var/www/media/;
  29. # Media files require user authentication
  30. auth_request /auth;
  31. }
  32. # Use the 'user' API endpoint for auth
  33. location /auth {
  34. internal;
  35. proxy_pass http://inventree-server:8000/auth/;
  36. proxy_pass_request_body off;
  37. proxy_set_header Content-Length "";
  38. proxy_set_header X-Original-URI $request_uri;
  39. }
  40. }