Skip to content
WJunction - Webmaster Forum

Redirect a subdomain to a port

Status
Not open for further replies.
Hello,

I have my Standard Domain www.example.com where is the content of my website. I configureted a Mail Server which is availlable on Port 8777 on my Standard Domain and on mail.example.com. But it should only be available on mail.example.com. Also it should automatic redirect to port 8777 if i enter mail.example.com on my Browser!
How can I do it? I am using Apache2.4.56 as webserver on a debian 11 Server with a the mailcow docker as mailserver and the apache is Reserve Proxy for the Mail Server also!
 

2 comments

I'll assume you mean that your mail server has a web interface exposed on port 8777.
In this case, use Apache's reverse proxy to proxy to 127.0.0.1:8777

So you'll need to:
1. Create a file "/etc/apache2/sites-available/mail.conf" with ServerName mail.example.com

2. Add a Reverse Proxy Configuration in the configuration
ProxyPass "/" "hxxp://127.0.0.1:8777/"
ProxyPassReverse "/" "hxxp://127.0.0.1:8777/"

3. Then enable your configuration
a2ensite mail

4. Restart apache
systemctl restart apache2

Replace xx with tt. Hope this helps! :-)
 
Status
Not open for further replies.

About the author

F
Member · Joined
8
Messages
0
Reactions
1
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom