@@ -51,15 +52,79 @@ Where `APP_NAME` is the app you want to theme and `THEME.css` is the name of the
location /sonarr {
proxy_pass http://localhost:8989/sonarr;
include /config/nginx/proxy.conf;
- proxy_set_header Accept-Encoding "";
- sub_filter
- ''
- '
- ';
- sub_filter_once on;
+ proxy_set_header Accept-Encoding "";
+ sub_filter
+ ''
+ '
+ ';
+ sub_filter_once on;
}
```
+### Nginx Variable
+
+You can also setup Nginx to use variables to change the themes. This will update the theme on all your location blocks by just changing 1 variable. This is nice if you quickly want to change colors on all of your apps.
+
+#### http block
+
+In you http block add the following:
+
+```nginx
+# THEME.PARK
+map $host $theme {
+ default ;
+}
+```
+Change `` to the theme you want on all your apps. e.g. `default dark;`
+
+Available themes are:
+ `aquamarine`
+ `hotline`
+ `plex`
+ `dark`
+ `space-gray`
+
+#### theme-park.conf
+Next create a new file called `theme-park.conf` and add the following code: (Note: It's not really necessary to create the conf file but I think it looks cleaner in the location blocks)
+
+```nginx
+ proxy_set_header Accept-Encoding "";
+ sub_filter
+ ''
+ '
+ ';
+ sub_filter_once on;
+```
+As you can see the URL has variables in it `/$app/$theme.css`
+The `$theme` variable is set in the http block and will affect all server blocks. And the `$app` variable is set in the location block.
+
+#### location blocks
+
+Now in the location block use the include syntax and include the theme-park.conf file and set the $app variable, like so:
+
+```nginx
+ set $app sonarr;
+ include /config/nginx/theme-park.conf;
+```
+
+**Example**
+```nginx
+location /sonarr {
+ proxy_pass http://192.168.1.34:8990/sonarr;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_redirect off;
+ proxy_buffering off;
+ proxy_http_version 1.1;
+ proxy_no_cache $cookie_session;
+ set $app sonarr;
+ include /config/nginx/theme-park.conf;
+ }
+```
+
+Now when you change the variable in the http block and restart nginx, it will update the theme for all your apps!
+
### Apache (Untested)
```apache
AddOutputFilterByType SUBSTITUTE text/html