nginx.conf 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. server {
  2. listen [::]:443 ssl ipv6only=off;
  3. # CHANGE THIS TO YOUR SERVER'S NAME
  4. server_name netbox.example.com;
  5. ssl_certificate /etc/ssl/certs/netbox.crt;
  6. ssl_certificate_key /etc/ssl/private/netbox.key;
  7. client_max_body_size 25m;
  8. location /static/ {
  9. alias /opt/netbox/netbox/static/;
  10. }
  11. location / {
  12. # Remove these lines if using uWSGI instead of Gunicorn
  13. proxy_pass http://127.0.0.1:8001;
  14. proxy_set_header X-Forwarded-Host $http_host;
  15. proxy_set_header X-Real-IP $remote_addr;
  16. proxy_set_header X-Forwarded-Proto $scheme;
  17. # Uncomment these lines if using uWSGI instead of Gunicorn
  18. # include uwsgi_params;
  19. # uwsgi_pass 127.0.0.1:8001;
  20. # uwsgi_param Host $host;
  21. # uwsgi_param X-Real-IP $remote_addr;
  22. # uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
  23. # uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
  24. }
  25. }
  26. server {
  27. # Redirect HTTP traffic to HTTPS
  28. listen [::]:80 ipv6only=off;
  29. server_name _;
  30. return 301 https://$host$request_uri;
  31. }