40 lines
1.3 KiB
Plaintext
40 lines
1.3 KiB
Plaintext
|
server {
|
||
|
listen 443;
|
||
|
server_name *.zoo.example.org;
|
||
|
|
||
|
ssl on;
|
||
|
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||
|
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||
|
|
||
|
access_log /var/log/nginx/zoo.example.org-access.log combined;
|
||
|
error_log /var/log/nginx/zoo.example.org-error.log;
|
||
|
|
||
|
location ~ ^/static/(.+)$ {
|
||
|
root /;
|
||
|
try_files /var/lib/zoo/tenants/$host/static/$1
|
||
|
/var/lib/zoo/collectstatic/$1
|
||
|
=404;
|
||
|
}
|
||
|
|
||
|
location / {
|
||
|
proxy_pass http://unix:/run/zoo/zoo.sock;
|
||
|
proxy_set_header Host $http_host;
|
||
|
proxy_set_header X-Forwarded-SSL on;
|
||
|
proxy_set_header X-Forwarded-Protocol ssl;
|
||
|
proxy_set_header X-Forwarded-Proto https;
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
server_name *.zoo.example.org;
|
||
|
|
||
|
access_log /var/log/nginx/zoo.example.org-access.log combined;
|
||
|
error_log /var/log/nginx/zoo.example.org-error.log;
|
||
|
|
||
|
return 301 https://$host$request_uri;
|
||
|
}
|
||
|
|