Nginx sub_filter with react reddit / selfhosted ---------------------------------------------------------------------- FloppyTomatoes · 2023-11-19 12:48 I am looking into putting a SSO app in front of my reverse proxy (nginx). I am currently testing Authelia and it works well. The only thing that is irking me is the page title that it creates "Login - Authelia", and it doesn't offer any way to change this. The people that will be using the SSO would have no idea what this is, so just want to change it to the name of my site for clarity. ​ I have tried using sub\_filter to change this, and it sort of works. It changes the title briefly in the html, but there is a document.title call within the react app that changes it back right after. I am having no luck replacing this call. I've tried the following unsuccessfully in my location block to change the js: gzip off; proxy_set_header Accept-Encoding ""; sub_filter_once off; sub_filter_types *; sub_filter 'document.title=`$dollar{r("Login")} - Authelia`' 'document.title=`$dollar{r("Login")} - Site Name`'; Any ideas here, or maybe there is a better approach on how to handle this? ​ ---------------------------------------------------------------------- ElevenNotes · 2023-11-19 14:35 Simple answer: You can't. React is resetting the title on the client, no call via webserver. It's easier to add your own javascript to the website and change the title like this.