30 lines
743 B
Django/Jinja
30 lines
743 B
Django/Jinja
server {
|
|
listen [::]:443 ssl ipv6only=off;
|
|
|
|
# CHANGE THIS TO YOUR SERVER'S NAME
|
|
server_name {{ netbox_server_name }};
|
|
|
|
ssl_certificate /etc/pki/tls/certs/{{ netbox_server_name }}.crt;
|
|
ssl_certificate_key /etc/pki/tls/certs/{{ netbox_server_name }}.crt;
|
|
|
|
client_max_body_size 25m;
|
|
|
|
location /static/ {
|
|
alias /opt/netbox/netbox/static/;
|
|
}
|
|
|
|
location / {
|
|
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;
|
|
}
|
|
}
|
|
|
|
server {
|
|
# Redirect HTTP traffic to HTTPS
|
|
listen [::]:80 ipv6only=off;
|
|
server_name _;
|
|
return 301 https://$host$request_uri;
|
|
}
|