Skip to content

Instantly share code, notes, and snippets.

@spiritualized
Last active May 25, 2023 17:09
Show Gist options
  • Save spiritualized/c87fc97148e279b4c59c6fb51c1a7050 to your computer and use it in GitHub Desktop.
Save spiritualized/c87fc97148e279b4c59c6fb51c1a7050 to your computer and use it in GitHub Desktop.
Wizarr reverse proxy nginx config for a URL prefix
# Nginx reverse proxy config for wizarr in docker on a URL prefix
# Use docker's DNS
resolver 127.0.0.11;
# wizarr
location /wizarr/ {
set $upstream_app wizarr;
proxy_pass http://$upstream_app:5690;
# Remove /wizarr path to pass to the app
rewrite ^/wizarr/?(.*)$ /$1 break;
# Redirect location headers
proxy_redirect ^ /$upstream_app;
proxy_redirect /admin /$upstream_app/admin;
proxy_redirect /login /$upstream_app/login;
# Sub filters to replace hardcoded paths
#proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types *;
sub_filter '/static/' '/$upstream_app/static/';
sub_filter 'href="/"' 'href="/$upstream_app"';
sub_filter 'action="/' 'action="/$upstream_app/';
sub_filter 'hx-post="/' 'hx-post="/$upstream_app/';
sub_filter 'hx-get="/' 'hx-get="/$upstream_app/';
sub_filter '"/scan?plex_url="' '"/$upstream_app/scan?plex_url="';
sub_filter '"/jf-scan?plex_url="' '"/$upstream_app/jf-scan?plex_url="';
sub_filter '"/scan-specific"' '"/$upstream_app/scan-specific"';
sub_filter '"/jf-scan-specific"' '"/$upstream_app/jf-scan-specific"';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment