44 lines
2.4 KiB
Django/Jinja
44 lines
2.4 KiB
Django/Jinja
server {
|
|
listen 443 ssl http2;
|
|
{% if inventory_hostname in wg_clients -%}
|
|
listen {{ wg_clients[inventory_hostname].ip }}:443 ssl http2;
|
|
{% endif -%}
|
|
|
|
include listen-proxy-protocol.conf;
|
|
server_name {{ invidious_url }};
|
|
|
|
# access_log off;
|
|
access_log /var/log/nginx/access_{{ invidious_url }}.log main;
|
|
error_log /var/log/nginx/error_{{ invidious_url }}.log warn;
|
|
|
|
ssl_certificate /usr/local/etc/certs/{{ invidious_url }}/fullchain.pem;
|
|
ssl_certificate_key /usr/local/etc/certs/{{ invidious_url }}/privkey.pem;
|
|
|
|
#add_header "Content-Security-Policy" "default-src data: 'self' 'unsafe-inline' 'unsafe-eval'; media-src 'self'; base-uri 'none' https://*.googlevideo.com; frame-ancestors 'none'; form-action 'self'; block-all-mixed-content" always;
|
|
#add_header "Referrer-Policy" "no-referrer" always;
|
|
#add_header "Content-Security-Policy" "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline' blob: https://*.googlevideo.com:443 https://*.youtube.com:443 data:; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; manifest-src 'self'; media-src 'self' blob: https://*.googlevideo.com:443 https://*.youtube.com:443; child-src 'self' blob:; frame-src 'self'; frame-ancestors 'none'" always;
|
|
# curl -sIX GET http://172.18.0.140:3000/watch\?v\=xhPwN6t07lo
|
|
add_header "Content-Security-Policy" "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; manifest-src 'self'; media-src 'self' blob: https://*.googlevideo.com:443 https://*.youtube.com:443; child-src 'self' blob:; frame-src 'self'; frame-ancestors 'none'" always;
|
|
|
|
location ~ ^/api/health {
|
|
allow 127.0.0.1;
|
|
allow {{ my_public_ips[inventory_hostname] }}/32;
|
|
allow {{ my_public_ips[ansible_control_host] }}/32;
|
|
deny all;
|
|
|
|
proxy_pass http://{{ bridgewithdns.invidious }}:3000;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header Host $host;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://{{ bridgewithdns.invidious }}:3000/;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header Host $host; # so Invidious knows domain
|
|
proxy_http_version 1.1; # to keep alive
|
|
proxy_set_header Connection ""; # to keep alive
|
|
}
|
|
}
|