xoxys.jellyfin/templates/nginx/vhost.j2
Robert Kaussow f86afc5e3a
Some checks failed
continuous-integration/drone/push Build is failing
add nginx vhost config
2019-02-02 00:57:15 +01:00

39 lines
1.0 KiB
Django/Jinja

#jinja2: lstrip_blocks: True
# {{ ansible_managed }}
upstream backend_jellyfin {
server {{ jellyfin_nginx_proxy_ip }}:{{ jellyfin_nginx_proxy_port }};
}
server {
listen 80;
server_name {{ jellyfin_base_url | urlsplit('hostname') }};
client_max_body_size 200M;
{% if jellyfin_nginx_tls_enabled %}
return 301 https://$server_name$request_uri;
{% else %}
location / {
proxy_pass {{ 'https' if jellyfin_tls_enabled else 'http' }}://backend_jellyfin;
proxy_set_header X-Forwarded-For $remote_addr;
}
{% endif %}
}
{% if jellyfin_nginx_tls_enabled %}
server {
listen 443 ssl;
server_name {{ jellyfin_base_url | urlsplit('hostname') }};
client_max_body_size 200M;
location / {
proxy_pass {{ 'https' if jellyfin_tls_enabled else 'http' }}://backend_jellyfin;
proxy_set_header X-Forwarded-For $remote_addr;
}
ssl_certificate /etc/pki/tls/certs/{{ jellyfin_nginx_tls_cert_file }};
ssl_certificate_key /etc/pki/tls/private/{{ jellyfin_nginx_tls_key_file }};
}
{% endif %}