How to implement a reverse proxy by skipping paths (nginx)? #6850
Unanswered
alantoledo007
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Check out my sample here and let me know if that helps. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone. I have an eCommerce project where I want to implement a custom domains feature for my users. So, I did a reverse proxy with nginx and got the following problem:
Now, my users' stores point to myproject.com/:store-slug. So, I need
clientdomain.com
to pass tomyproject.com/:store-slug
(different paths) through a reverse proxy (nginx). But it throws an error with Remix, since since the paths are different, it starts crashing.It returns the following error message:
cannot access (meta or links or handle) from undefined
.This does not happen if the routes match (clientdomain.com/:store-slug -> myproject.com/:store-slug).
(I've solved this by redirecting clientdomain.com to clientdomain.com/:store-slug, but I don't like that solution)
Does anyone have an idea how I do so Remix can understand that clientdomain.com is the same as myprojet.com/:store-slug?
I leave my nginx configuration and the error message that I was commenting on.
With redirect - OK
Direct - FAIL
in summary
I need a path omitted. That is, the application already has the path /:slug and with the proxy, I make the main path (/) point to (/:slug), therefore there is a kind of carrying of paths:
grabacion-de-pantalla-2023-07-18-a-la-s-100616_9TVcpPsq.mp4
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions