diff --git a/docs/extending-overseerr/reverse-proxy-examples.md b/docs/extending-overseerr/reverse-proxy-examples.md index 8fa120ee9..659feb88b 100644 --- a/docs/extending-overseerr/reverse-proxy-examples.md +++ b/docs/extending-overseerr/reverse-proxy-examples.md @@ -1,12 +1,12 @@ # Reverse Proxy Examples {% hint style="warning" %} -Base URLs cannot be configured in Overseerr. With this limitation, only subdomain configurations are supported. +Base URLs cannot be configured in Overseerr. With this limitation, only subdomain configurations are supported. However, a Nginx subfolder workaround configuration is provided below to use at your own risk. {% endhint %} -## [SWAG (Secure Web Application Gateway, formerly known as `letsencrypt`)](https://github.com/linuxserver/docker-swag) +## SWAG -A sample proxy configuration is included in SWAG. However, this page is still the only source of truth, so the SWAG sample configuration is not guaranteed to be up-to-date. If you find an inconsistency, please [report it to the LinuxServer team](https://github.com/linuxserver/reverse-proxy-confs/issues/new) or [submit a pull request to update it](https://github.com/linuxserver/reverse-proxy-confs/pulls). +A sample proxy configuration is included in [SWAG (Secure Web Application Gateway)](https://github.com/linuxserver/docker-swag). However, this page is still the only source of truth, so the SWAG sample configuration is not guaranteed to be up-to-date. If you find an inconsistency, please [report it to the LinuxServer team](https://github.com/linuxserver/reverse-proxy-confs/issues/new) or [submit a pull request to update it](https://github.com/linuxserver/reverse-proxy-confs/pulls). To use the bundled configuration file, simply rename `overseerr.subdomain.conf.sample` in the `proxy-confs` folder to `overseerr.subdomain.conf`. Alternatively, create a new file `overseerr.subdomain.conf` in `proxy-confs` with the following configuration: @@ -53,11 +53,14 @@ labels: For more information, see the Traefik documentation for a [basic example](https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/). -## `nginx` +## Nginx + +{% tabs %} +{% tab title="Subdomain" %} Add the following configuration to a new file `/etc/nginx/sites-available/overseerr.example.com.conf`: -```text +```nginx server { listen 80; server_name overseerr.example.com; @@ -111,6 +114,46 @@ Then, create a symlink to `/etc/nginx/sites-enabled`: ```bash sudo ln -s /etc/nginx/sites-available/overseerr.example.com.conf /etc/nginx/sites-enabled/overseerr.example.com.conf ``` +{% endtab %} + +{% tab title="Subfolder" %} + +{% hint style="warning" %} +Nginx subfolder reverse proxy is unsupported. The sub filters may stop working when Overseerr is updated. Use at your own risk! +{% endhint %} + +Add the following location block to your existing `nginx.conf` file. + +```nginx +location ^~ /overseerr { + set $app 'overseerr'; + # Remove /overseerr path to pass to the app + rewrite ^/overseerr/?(.*)$ /$1 break; + proxy_pass http://127.0.0.1:5055; # NO TRAILING SLASH + # Redirect location headers + proxy_redirect ^ /$app; + proxy_redirect /setup /$app/setup; + proxy_redirect /login /$app/login; + # Sub filters to replace hardcoded paths + proxy_set_header Accept-Encoding ""; + sub_filter_once off; + sub_filter_types *; + sub_filter 'href="/"' 'href="/$app"'; + sub_filter 'href="/login"' 'href="/$app/login"'; + sub_filter 'href:"/"' 'href:"/$app"'; + sub_filter '/_next' '/$app/_next'; + sub_filter '/api/v1' '/$app/api/v1'; + sub_filter '/login/plex/loading' '/$app/login/plex/loading'; + sub_filter '/images/' '/$app/images/'; + sub_filter '/android-' '/$app/android-'; + sub_filter '/apple-' '/$app/apple-'; + sub_filter '/favicon' '/$app/favicon'; + sub_filter '/logo.png' '/$app/logo.png'; + sub_filter '/site.webmanifest' '/$app/site.webmanifest'; +} +``` +{% endtab %} +{% endtabs %} Next, test the configuration: