Question

virtualmin: Subdomain be hosted on another lan server but use same external IP.

First, I would like to thank the community here… your answers and tutorial has really helped me in the past year. Maybe someday i would be able to pay the favor back. A heartfelt Thank you. I have this weird problem. I have two servers, lan addresses 192.168.1.10 and 192.168.1.11 . i have set up webmin/virtualmin on 192.168.1.10. I have forward port 80,53,587,465,143 on my router to point to 192.168.1.10. The main domain example.com is hosted in 192.168.1.10, it works fine. I added a subdomain users.example.com to example.com in 192.168.1.10 then i modified the DNS A record of users.example.com to point to 192.168.1.11 instead of my external IP. Here is the weird part. If i am in the lan network (my computer address is 192.168.1.12) i can surf both example.com and users.example.com very well with no problem. But if am at home i can only surf example.com ,** users.example.com** says no response. What am i missing,Dint the DNS Propagate? i need both example.com and users.example.com to have the same external IP but users.example.com to be load from 192.168.1.11 . How can i achieve this? I couldn’t figure this out since last November! any help i would greatly appreciate.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

I found a solution that works for me, May be it will help somebody someday. i went to my first server 192.168.1.10 and made sure each of the modules are enable below: sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod proxy_balancer sudo a2enmod lbmethod_byrequests Then i logged on in my virtualmin on my first server 192.168.1.10 and created a subdomain users.example.com. I navigated to the new subdomain in my virtualmin. Click on Server Configuration>Edit Proxy Website Proxying enable [yes] proxy to url [http://192.168.1.11/] click save and apply. Reboot server. Thats it!

p.s. my server is ubuntu 16.04 and webmin/virtualmin 6.02

This is really great, exactly what I was looking for, thank you. If only it would be possible to set it up for https too.

Domains and IPs are public info, why are you redacting them?

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel