ansible/roles/noodlehub/templates/nginx_vhost.j2
Thomas Schmid aa6286623d add klipper related roles and noodlehub role
Signed-off-by: Thomas Schmid <tom@lfence.de>
2022-01-20 20:40:32 +01:00

60 lines
1.4 KiB
Django/Jinja

{% if not noodlehub_ssl %}
server {
listen 80;
listen [::]:80;
server_name {{ noodlehub_domain }};
location / {
client_max_body_size 1024M;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_http_version 1.1;
proxy_pass http://localhost:5000;
}
}
{% else %}
server {
listen 80;
listen [::]:80;
server_name {{ octoprint_domain }};
location /.well-known/acme-challenge {
default_type "text/plain";
alias /var/www/acme-challenge;
}
location / {
return 301 https://{{ octoprint_domain }}$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ gitea_domain }};
ssl_certificate_key /etc/nginx/ssl/{{ gitea_domain }}.key;
ssl_certificate /etc/nginx/ssl/{{ gitea_domain }}.crt;
location / {
client_max_body_size 1024M;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /octoprint;
proxy_http_version 1.1;
proxy_pass http://localhost:5000;
}
}
{% endif %}