5624ecc65e
The reason is that in the default configuration nginx is only serving 'http' traffic. So if an upstream proxy sets the 'X-Forwarded-Proto' header, because it is terminating TLS, then nginx will overwrite it to 'http'. This will cause django to think the page is served via 'http' and it will not create 'https://...' URLs. Related to #292
36 lines
810 B
Nginx Configuration File
36 lines
810 B
Nginx Configuration File
daemon off;
|
|
worker_processes 1;
|
|
|
|
error_log /dev/stderr info;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
keepalive_timeout 65;
|
|
gzip on;
|
|
server_tokens off;
|
|
client_max_body_size 10M;
|
|
|
|
server {
|
|
listen 8080;
|
|
access_log off;
|
|
|
|
location /static/ {
|
|
alias /opt/netbox/netbox/static/;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://netbox:8001;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
|
|
}
|
|
}
|
|
}
|