server { listen %%interface%%:%%port%% default_server; #include /etc/nginx/includes/server_params.conf; #include /etc/nginx/includes/proxy_params.conf; client_max_body_size 0; location / { add_header Access-Control-Allow-Origin *; proxy_connect_timeout 30m; proxy_send_timeout 30m; proxy_read_timeout 30m; proxy_pass http://127.0.0.1:6767; # Allow websocket proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; #auth_basic off; # Adjust Location headers in backend redirects # Bazarr is Flask-based and answers /bazarr with a redirect to /bazarr/, # made absolute against the Host nginx sends upstream, so it reads # http://127.0.0.1:6767/bazarr/. proxy_redirect strips that prefix, and # nginx then re-absolutises the result as $scheme://$host:$server_port/... # i.e. http://:8099/bazarr/ -- blocked by the browser as mixed # content inside the ingress iframe. absolute_redirect off keeps it # relative; the proxy_redirect rules re-prefix it with the ingress entry # (the second rule also covers a redirect that was relative already). absolute_redirect off; # Do not add port to redirect proxy_redirect http://127.0.0.1:6767/ %%ingress_entry%%/; proxy_redirect / %%ingress_entry%%/; # Correct base_url proxy_set_header Accept-Encoding ""; sub_filter_once off; sub_filter_types *; sub_filter /bazarr %%ingress_entry%%/bazarr; } }