44 lines
939 B
Text
44 lines
939 B
Text
|
{% macro tandoor_common() %}
|
||
|
location /static/ {
|
||
|
alias /var/www/recipes/staticfiles;
|
||
|
}
|
||
|
|
||
|
location /media/ {
|
||
|
alias /var/www/recipes/mediafiles;
|
||
|
}
|
||
|
|
||
|
location / {
|
||
|
proxy_set_header Host $http_host;
|
||
|
proxy_pass http://unix:/var/www/recipes/recipes.sock;
|
||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
}
|
||
|
{% endmacro %}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
|
||
|
server_name {{var_tandoor_and_nginx_domain}};
|
||
|
|
||
|
{% if var_tandoor_and_nginx_tls_mode == 'force' %}
|
||
|
return 301 https://$http_host$request_uri;
|
||
|
{% else %}
|
||
|
{{ tandoor_common() }}
|
||
|
{% endif %}
|
||
|
}
|
||
|
|
||
|
{% if var_tandoor_and_nginx_tls_mode != 'disable' %}
|
||
|
server {
|
||
|
listen 443 ssl;
|
||
|
listen [::]:443 ssl;
|
||
|
|
||
|
server_name {{var_tandoor_and_nginx_domain}};
|
||
|
|
||
|
ssl_certificate_key /etc/ssl/private/{{var_tandoor_and_nginx_domain}}.pem;
|
||
|
ssl_certificate /etc/ssl/fullchains/{{var_tandoor_and_nginx_domain}}.pem;
|
||
|
include /etc/nginx/ssl-hardening.conf;
|
||
|
|
||
|
{{ tandoor_common() }}
|
||
|
}
|
||
|
{% endif %}
|