pfSense haproxy - Proxy to subdirectory

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 :wink: 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.


HAProxy examines the front end and uses the ACL to match the back end destination.

Thanks @LTS_Tom - I watched the video twice. The multiple servers is working. What I am trying to do is have actually point to www.internal.lan/subsite. It isn’t a 301 redirect (e.g. I don’t want to become - I can get that to work). Rather, I want redirection to be right to the subsite like I have done with nginx.

Did you ever figure this out?

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 getting me to the Apache Tomcat management page. This is not desired. 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.

No luck despite lots of research via Google University, reading the haproxy docs and many trials using a VM.

I find it strange that you can easily do this using Apache HTTPD or nginx but does not seem possible to do so using haproxy…

I am still hunting for an answer too.

You mentioned that you are able to do a redirect from to 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.