Remix + Reverse Proxy + Dynamic Basename #6797
-
Hi there, We are building a white-label e-commerce product with Remix -- so far it has really been a breeze to build out with. Unfortunately, we are running into a major roadblock in moving forward with our first release. Most of our partners have a WordPress or similar CMS with a domain like: We have an existing client-side solution in place with a typical React (remix-run/router) application and we are able to dynamically set basename and proxy through from a path that is something other than We were hoping to do that with Remix, but after a fair amount of research, searching through Discord and here on Github, I am not seeing a viable solution. I've looked into @kiliman solution with I have experimented with Are there any plans to support something like this, or does anyone have any thoughts or solutions on how we might accomplish this? I will try and put up a minimal repo with an example docker nginx reverse proxy showing what we are doing if that will help. Here is a reproduction with a docker nginx reverse proxy that runs automatically with Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
Hi. Yeah if you can provide a simple repo, I'll see what I can do to help with your use case. Never mind. I see you added a link. I'll keep you posted. |
Beta Was this translation helpful? Give feedback.
-
Thanks @kiliman and @wesleygrimes This seems like an obvious required feature in remix. But by using https://github.com/kiliman/remix-proxy-basename, I have this solved too. The only change I made, was to use an environment variable to determine the path, instead of a header. |
Beta Was this translation helpful? Give feedback.
I think that instead of using cookies for setting basename, you should configure
nginx
to set a header that Remix uses.I never understood the need for cookies, as the
basename
is a server concern and not something the client should tell the server, which is what cookies are. The nice thing about the header is that it's only added by the proxy->remix path, so the client doesn't even know (or care).