I’m in the process of moving from nginx as a reverse proxy to haproxy (one less VM to worry about…).
I want to proxy to a specific URL, not just the server.
In nginx, all I have to do is with nginx is:
location / {
include proxy_params;
proxy_pass http://internal_server/subdirectory/;
allow all;
}
But, after a weekend of Google University I still cannot figure out how to do it with haproxy. Does it go in the frontend or backend? I assume that it would be part of the ACL and Actions but everyone knows what assumes means.
Thanks @LTS_Tom - I watched the video twice. The multiple servers is working. What I am trying to do is have www.site.org actually point to www.internal.lan/subsite. It isn’t a 301 redirect (e.g. I don’t want www.site.org to become www.site.org/subsite - I can get that to work). Rather, I want redirection to be right to the subsite like I have done with nginx.
I am trying to do something similar. I want to expose my Apache Guacamole server, but not the tomcat server it runs on.
Right now I have guac.mydomain.com getting me to the Apache Tomcat management page. This is not desired. guac.mydomain.com/guacamole will get me to the Guacamole login screen as desired. This is good, but I do not want to expose the Apache Tomcat management page.
In nginx, I would just do the proxypass as you show in your original post, but I do not understand HAProxy well enough to make it behave similarly.
You mentioned that you are able to do a redirect from www.site.org to www.site.org/subsite. How did you do that? I think that would be a sufficient work around for me right now, but I get ERR_TOO_MANY_REDIRECTS every time I try that.
I too am looking for a solution to this. It is stupid simple in NGINX with proxy_pass to whatever internal URL string you want. But HAProxy seems to be only capable of IP:Port.
Has anyone been able to solve this? I am looking to do my setup with a bunch of subfolders and am just running into some issues. Any help would be greatly appreciated!