-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HELP] URL rewrite for static files #418
Comments
@kAleksei That is the expected behavior of virtual directory. Are you trying to achieve something else? Your expected behavior seems to not requiring a virtual directory. Try remove all virtual directory entries and see if it will works like you expected? |
@tobychui, I'm trying to achieve that static files will also use virtual directory route. Static files to be routed for this container: https://mydomain.com/web-check/style.css I want to archive that multiple containers will be routed using path based routing. I see that I have "Referrer" header with destination, maybe I can redirect of rewrite the request url with this header? Let me know if this makes sense for you. |
@kAleksei If that is the case, you will need to add the sub-path (e.g.
As it is a virtual directory, Zoraxy will rewrite the upstream path for you from the Vdir path to upstream path (aka if you do not add the sub-directory in upstream path, Zoraxy will use the root path "/" as your directory). We actually copied this logic from Apache, so it might not be 100% matching of what Nginx offer. You might need some time to get used to it if you are new to virtual directories. If this is still not what you want, I guess you might need to explain more on your use case with a diagram of some sort. |
What happened?
I'm trying to setup path routing to my containers. When I set up Virtual Directory with path to exact container the request is coming there. But if the service running inside container has static files (e.g. css, js, png etc.) I'm receiving 404.
Example:
Container IP: 192.168.0.11:5555
Host: mydomain.com
Virtual Directory setup:
/app/ -> 192.168.0.11:5555
When I'm trying to access mydomain.com/app server respond 200 OK, but the static files are requesting with wrong path: mydomain.com/css/style.css instead of mydomain.com/app/css/style.css (no /app/ prefix)
Describe what have you tried
Describe the networking setup you are using
Here are some example, commonly asked questions from our maintainers:
Additional context
The text was updated successfully, but these errors were encountered: