Redirects with Virtual Server Set to Proxy Requests

Hi there!

Wanted to start off by saying thanks for the help in advance!
I have a server at my house that is currently running VirtualMin 6.13, where I am hosting several websites. The newest website I currently have set up is set to proxy to another machine, with a local IP address within my network. Everything to this point is working great, and the website being hosted is accessible both internally and externally.

For webmail, I used the install script section of VirtualMin to install roundcube. It installed without any problems, but I can’t seem to access it because the URL (mydomain).com/roundcube is being proxied to my other server, and virtualmin isn’t fulfilling the request.

I attempted to add a website redirect (VirtualMin > Server Configuration > Website Redirects) using the following values:
URL: /roundcube
Type: Alias to Directory
Destination: /home/(user)/public_html/roundcube
Even though I have this configured, the request still is getting sent to my proxied server instead and results in a page not found error.

How do I go about preventing that subdomain from being proxied and instead gets served by VirtualMin? I noticed that by default (mydomain).com/dav is being served by VirtualMin instead of my proxied machine. How do I mimic that for roundcube or other scenarios like this?

Operating system: Ubuntu Linux 18.04.4
Kernel and CPU: Linux 5.3.10-1-pve on x86_64

Thanks again,
Nate

Heyo-

I was actually able to figure this out based on another post about SSL Let’s Encrypt not working when proxy was enabled. That post suggested adding the following lines to the website configuration directives:

ProxyPass /.well-known/acme-challenge/ !
ProxyPassReverse /.well-known/acme-challenge/ !

I used the same logic and applied it to roundcube by adding the following lines:

ProxyPass /roundcube/ !
ProxyPassReverse /roundcube/ !

Hopefully this helps anyone else that ends up having the same issues!

1 Like

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.