c9d6b4d248
Nginx doesn't seem to support explcit intermedate cert chains [0] and we need to supply all of the certs together in a single file. Thankfully acme.sh does this and calls it the fullchain.cer file. Use that in the nginx config for graphite to fix issues with ssl verification to this service. [0] http://nginx.org/en/docs/http/configuring_https_servers.html#chains Change-Id: I318fb92a30c1593c2a2e4cb37496b16f17472f1d
62 lines
1.5 KiB
Django/Jinja
62 lines
1.5 KiB
Django/Jinja
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
server_name _;
|
|
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
server_name {{ inventory_hostname }};
|
|
|
|
ssl_certificate /etc/letsencrypt-certs/{{ inventory_hostname }}/fullchain.cer;
|
|
ssl_certificate_key /etc/letsencrypt-certs/{{ inventory_hostname }}/{{ inventory_hostname }}.key;
|
|
root /opt/graphite/static;
|
|
index index.html;
|
|
|
|
location /nginx_status {
|
|
stub_status on;
|
|
access_log off;
|
|
allow 127.0.0.1;
|
|
deny all;
|
|
}
|
|
|
|
# No remote login
|
|
location /admin {
|
|
allow 127.0.0.1;
|
|
deny all;
|
|
}
|
|
location /account {
|
|
allow 127.0.0.1;
|
|
deny all;
|
|
}
|
|
|
|
location /media {
|
|
# django admin static files
|
|
alias /usr/local/lib/python3.6/dist-packages/django/contrib/admin/media/;
|
|
}
|
|
|
|
location /admin/auth/admin {
|
|
alias /usr/local/lib/python3.6/dist-packages/django/contrib/admin/static/admin;
|
|
}
|
|
|
|
location /admin/auth/user/admin {
|
|
alias /usr/local/lib/python3.6/dist-packages/django/contrib/admin/static/admin;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8080;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type';
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
}
|
|
|
|
}
|