Forum Discussion
CSA
Nimbostratus
Jan 17, 2011Simple reverse proxy
Hi,
I'm trying to do something quite easy but I can't make it work.
I have an irule like this:
[...]
elseif {[HTTP::path] starts_with "/admin"} { HTTP::redirect pool preprod_admin_pool }
[...]
My pool has two web servers listening on port 8082, and their document root is "/".
I would like to have "/admin" removed from HTTP:uri on the backend requests (ie client still use myhost.com/admin/)
Can I do this easily ? I had a look to reverseproxy big irule but it looks complicated for what I want to achieve.
Thanks,
15 Replies
- Chris_Miller
Altostratus
So, is the issue that the user gets sent to the admin pool by requesting "/admin" which contains /directory/index.html. If the user clicks a link off of index.html, i.e. "/directory/foobar.html," they're no longer being sent to the admin pool, but to the business application. Is that the issue? - CSA
Nimbostratus
Exactly. That's why I need the /admin on the client side, and no /admin on the server side. - Chris_Miller
Altostratus
That makes more sense.
I suppose you could do something like this:
1. From HTTP_REQUEST, set a variable like "admin" to a value like "1" if [HTTP::path] started with "/admin." We'd then also get rid of "/admin" before sending the request to the server.
2. From HTTP_RESPONSE, we could check if "admin" equaled "1" and if it did, insert a cookie on the user's machine.
3. Then, we'd also add logic to our HTTP_REQUEST event so if the user had such a cookie, we'd send them to the admin pool regardless of whether their request contained /admin.
The immediate issue with that would be if the user no longer wanted to go to the admin pool but still had the cookie. I'll give it some thought and see if I can come up with something. - Chris_Miller
Altostratus
Quick question for you. Any chance you could use a different host header for admin traffic?
So, "admin.mydomain.com" goes to admin pool while "myapp.mydomain.com" goes to normal pool?
That way, you can send the traffic to the proper pool based on the host header rather than worrying about rewriting the path.
Just a thought. - CSA
Nimbostratus
Unfortunately, we can't do this. We already have many URLs and we are migrating from a system working with a /admin in the URL. In the previous configuration, there was a HTTP::redirect, so users saw the admin server hostname in the URL. In the new configuration, I'd like to have this name "masqueraded"
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
