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.

53 lines
1.2 KiB

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