Hello,
I need to host hugo site on an environment that has reverse proxy configured. In short, what happens is:
My hugo site is inside docker container
Reverse proxy is configured in a way that when I access: mysite/my-prefix/docs, the “my-prefix” tells the reverse proxy to route to my hugo site. Then it removes the prefix “my-prefix”, effectively accessing hugo-container/docs.
The problem:
All the urls inside the hugo container use normal routing, without the prefix, but due to reverse proxy I need to add the prefix “my-prefix” to all routes.
Example:
Hugo site wants to load the css files from mysite/my-styles.css, because thats the route inside the container. But from the browser it needs to access the css files through mysite.com/my-prefix/my-styles.css. I would like to be able to add this prefix at the beginning of every route
Only workaround I found so far was hardcoding /my-prefix before all .RelPermalink occurences in my theme, but that’s not the solution I want to stick with (though it works)
How to approach this problem?