Forum Discussion
Reverse proxy using DNS resolution?
I’m looking for options to create Virt (+iRule) on F5 that can process incoming connections with following logic:
- Resolve destination host of the request using specified DNS server
- Proxy request to result server (if DNS query were successful)
Nginx configuration of that logic (works currently) looks like this:
server {
listen 80;
server_name _;
location / {
resolver ;
proxy_pass http://$host:$request_uri;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Server;
}
}
This configuration, coupled with wildcard domain record, gives nice a quick way to create Public Access Endpoint to some dynamic cloud boxes…
blabla1.publicdomain.com blabla2.publicdomain.com
*.publicdomain.com - public DNS record pointing to the VIP
blabla1/blabla2 - gets resolved on private DNS (which gets updated during VM creation)
- Kevin_StewartEmployee
The example iRule on the wiki page for RESOLV::lookup should be pretty close to what you need:
https://devcentral.f5.com/wiki/iRules.resolv__lookup.ashx
If this is for HTTP traffic you'd probably want to switch the CLIENT_ACCEPTED event to HTTP_REQUEST and resolve on the HTTP::host value.
Recent Discussions
Related Content
* 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