ansible/roles/netbox/templates/vhost.j2

39 lines
758 B
Plaintext
Raw Normal View History

2020-07-19 12:43:12 +02:00
server {
listen 80;
listen [::]:80;
server_name {{ netbox_domain }};
location /.well-known/acme-challenge {
default_type "text/plain";
alias /var/www/acme-challenge;
}
location / {
2024-10-06 17:18:20 +02:00
return 301 https://$host$request_uri;
2020-07-19 12:43:12 +02:00
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ netbox_domain }};
ssl_certificate_key /etc/nginx/ssl/{{ netbox_domain }}.key;
ssl_certificate /etc/nginx/ssl/{{ netbox_domain }}.crt;
location /static/ {
alias /opt/netbox-{{ netbox_version }}/netbox/static/;
}
location / {
client_max_body_size 32M;
2021-08-31 19:02:20 +02:00
proxy_pass http://localhost:8001;
2020-07-19 12:43:12 +02:00
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
}