2020-04-03 15:46:48 -04:00
|
|
|
server {
|
2021-07-28 10:31:59 -04:00
|
|
|
listen [::]:443 ssl ipv6only=off;
|
2020-04-03 15:46:48 -04:00
|
|
|
|
|
|
|
# CHANGE THIS TO YOUR SERVER'S NAME
|
|
|
|
server_name netbox.example.com;
|
|
|
|
|
|
|
|
ssl_certificate /etc/ssl/certs/netbox.crt;
|
|
|
|
ssl_certificate_key /etc/ssl/private/netbox.key;
|
|
|
|
|
|
|
|
client_max_body_size 25m;
|
|
|
|
|
|
|
|
location /static/ {
|
|
|
|
alias /opt/netbox/netbox/static/;
|
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
2024-03-28 12:24:08 -07:00
|
|
|
# Remove these lines if using uWSGI instead of Gunicorn
|
2020-04-03 15:46:48 -04:00
|
|
|
proxy_pass http://127.0.0.1:8001;
|
|
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
2024-03-28 12:24:08 -07:00
|
|
|
|
|
|
|
# Uncomment these lines if using uWSGI instead of Gunicorn
|
|
|
|
# include uwsgi_params;
|
|
|
|
# uwsgi_pass 127.0.0.1:8001;
|
|
|
|
# uwsgi_param Host $host;
|
|
|
|
# uwsgi_param X-Real-IP $remote_addr;
|
|
|
|
# uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
# uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
|
|
|
|
|
2020-04-03 15:46:48 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
# Redirect HTTP traffic to HTTPS
|
2021-07-28 10:31:59 -04:00
|
|
|
listen [::]:80 ipv6only=off;
|
2020-04-03 15:46:48 -04:00
|
|
|
server_name _;
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|