logo smart home family kruse

Kruse Smart Home

Easy living in our smart home & Garden

Redirecting an URL from one Webmin server to another

Redirecting an URL from one Webmin server to another

10 February 2026

Jan-Willem

1. Introduction

Having two Raspberry Pi’s running each  Webmin /Virtualmin allows to have a test server and an operational server to prevent mistakes stops accessing your websites. As most people will have one external IP address it is required that the first server forwards specific URL’s to the second server.  This article describes how redirecting an URL from one Webmin server to another Webmin server needs to be setup.

2. Requirements

For hosting multiple websites on a Raspberry Pi with Virtualmin the following is required before redirecting an URL from one Webmin server to another:

3. Overview of example server setup

In this article we use the following setup as an example. Be aware that your IP adresses and port numbers will be different!

 

Server 1 (front server, public-facing)

  • Apache + Virtualmin
  • Serves:
    • gallery.fotokruse.eu → normal website
    • test.server.com → reverse proxy to Server 2

 

Server 2 (internal, IP address 192.168.1.44, port 12000)

  • Apache + Virtualmin
  • Only accessed internally via Server 1
  • CSF firewall enabled
  • Serves:
    • test.server.com

 

The setup will be such that:

  1. test.server.com: User goes to https://test.server.com and Apache webserver on Server 1 forwards the request to Server 2 at https://192.168.1.44. The browser URL stays test.server.com.
  2. gallery.fotokruse.eu: Server 1 handles this request.

 

Warning!! Replace the yellow highlighted IP addresses and ports with your own.

4. First time setup

This section describes the first time setup for redirecting an URL from one Webmin server to another (from server 1 to server 2) it involves more steps compared with redirecting a site once the first time setup has been done.

If the first time setup has been done you can skip this chapter and use the configuration steps described in chapter 5.

4.1 Configure server 1

Execute the following steps on server 1:

  1. Enable Required Apache Modules on Server 1 by opening the Terminal and entering the following commands:

    Check correct modules have been installed to allow redirecting an URL from one Webmin server to another:

    The following modules should at least be visible:
    – proxy_module
    – proxy_http_module
    – ssl_module
  2. Create a dedicated virtual host for test.server.com by going to Virtualmin and creating a virtual server. After clicking the Create button the virtual server will be created including SSL certificates.
  3. Test the site is working by going to https://test.server.com. It should show the default page from Virtualmin for your site originating from Server 1.
  4. Within Webmin open the filemanager via Tools > File Manager
  5. Within filemanager click on the folder icon in the upperleft and then go to the folder /etc/apache2/sites enabled
    Redirecting an URL from one Webmin server to another - configuring apache webserver
  6. Right mouse click on test.server.com and select edit
  7. Remove the line “ProxyPass /.well-known !” or disable the option by putting a # in front. Save and close the editor.
  8. Go to the existing info for port 443 (starts at something like ‘<VirtualHost *:443>’).
  9. Add the options below at the end of the 443 block, just before ‘</VirtualHost>’. Save the file and close the editor.
  10. Open the Terminal via Tools > Terminal and restart the Apache webserver:

4.2 Configure server 2

4.2.1 Configure Webmin/Virtualmin

Execute the following steps on Server 2:

  1. Configure the ports and addresses by selecting Webmin → Webmin Configuration → Ports and Addresses and make sure following settings are made:
    – Listen on: 192.168.1.44 or 0.0.0.0
    – Port: 12000
  2. Set trusted referers on Server 2 by selecting menu option Webmin → Webmin Configuration → Trusted Referers. Add test.server.com. This will prevent Webmin blocking proxy requests.
4.2.2 Open required ports in the firewall

The instructions below are for the firewall ConfigServer Security & Firewall (CSF):

 

    1. Allow LAN access (from local network) to Webmin port 12000 by opening the CSF allow file:

      Add the following:

      Save the file and close the editor.
    2. Add port 12000 to CSF allowed TCP_IN by opening the CSF config file:

      Find the line which looks like:

      And add the port 12000. Save the file and close the editor.
    3. Reload CSF:
    4. Test the port is open:

5. Setup next website(s)

Once the first time setup has been done the steps for redirecting an URL from one Webmin server to another (from server 1 to server 2) becomes easier. The site used as an example now is https://testnew.server.com.

5.1 Configure server 1

Execute the following steps on server 1:

  1. Create a dedicated virtual host for testnew.server.com by going to Virtualmin and creating a virtual server. After clicking the Create button the virtual server will be created including SSL certificates.NOTE: If you have restored a Virtualmin backup (for example see Restoring a Piwigo backup at a Webmin server) then this step can be skipped as the restore will take care of this.
  2. Test the site is working by going to https://testnew.server.com. It should show the default page from Virtualmin for your site.
  3. Within Webmin open the filemanager via Tools > File Manager
  4. Within filemanager click on the folder icon in the upperleft and then go to the folder /etc/apache2/sites enabled
  5. Right mouse click on testnew.server.com and select edit
  6. Modify the existing info for port 443 (starts at something like ‘<VirtualHost *:443>’).
    a. Add the options below at the end of the 443 block, just before ‘</VirtualHost>’.
  7. Remove the line “ProxyPass /.well-known !” or disable the option by putting a # in front.
  8. Save and close the editor.
  9. Open the Terminal via Tools > Terminal and restart the Apache webserver:

5.2 Configure server 2

Now Server 1 has been configured for redirecting an URL from one Webmin server to another it is time to configure Webmin/Virtualmin on Server 2 by executing the following steps:

  1. Set trusted referers by selecting menu option Webmin → Webmin Configuration → Trusted Referers.
  2. Add testnew.server.com.This will prevent Webmin blocking proxy requests.
  3. Create the virtual server testnew.server.com at Server 2. Enabled features can be modified as needed. In the example only Apache website is selected.NOTE: If you have restored a Virtualmin backup (for example see Restoring a Piwigo backup at a Webmin server) then this step can be skipped as the restore will take care of this.

5.3. Testing

 

  1. Open https://testnew.server.com. It should show the site from Server 2, URL stays the same.
  2. Open https://gallery.fotokruse.eu. Check that this website running on Server 1 works.

 

This concludes the setup of redirecting an URL from one Webmin server to another Webmin server.

7. Common issues

Some issues which might occur redirecting an URL from one Webmin server to another:

  • Piwigo website does not work and gives error message; see Restoring a Piwigo backup at a Webmin server, likely it has to do with server quota set.
  • LProxyEngine Off → HTTPS proxy fails
  • Webmin redirecting to its own hostname/IP → add Trusted Referers and disable forced redirects
  • CSF blocks port(s) → check with csf -g
Article by <a href="https://smarthome.familykruse.eu/author/iamjwk/" target="_self">Jan-Willem</a>

Article by Jan-Willem

Position

Writen by the website owner

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *