Community discussions

 
Ameeno
just joined
Topic Author
Posts: 7
Joined: Sun Apr 29, 2018 1:25 am

Multiple web addresses Behind router.

Sun Aug 04, 2019 12:42 am

Hello All.

I am using a hap AC2 as my main internet router, but my ISP gives me just a single IP address.

I have multiple computers (VM's) hosting different things at home which i want to access from outside world.

Currently I am using nat port forwarding to port forward port 80 & 443 to a single web server which works fine.

so *.test.com:80 will go to 192.168.0.5:80

However what different domains/subdomains go to different VM's?
How can i do that on mikrotic.

for example if server1.test.com:80 will go to 192.168.0.5:80
but server2.test.com:80 should go to 192.168.0.6:80


Currently I think i could do A) have a single Nginx vm proxy vm that does port forwarding inside the lan:

so *:80 > 192.168.0.4:80 (nginx transparent proxy) > seperate
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1700
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: Multiple web addresses Behind router.

Sun Aug 04, 2019 12:48 am

Hey

firewall is ip based, not domain.

What you want to do is normally done on the webserver itself, as the requested domain is part of the request.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1239
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Multiple web addresses Behind router.

Sun Aug 04, 2019 10:08 am

If you do run all server on Windows IIS or Linux Apache, they can both handle multiple Webservers based on DNS.

But If you have many Webservers on different system or on different ports, you can use a reverse proxy server like HAProxy.
Redirect 80(443) to the HAProxy server, then it can based on rules send these request to other server and ports.
HAProxy is free and can du much more, such as load balancing (multiple server handles request from same domain)
It can use different servers depending on path, so my-domain/folder1 goes to one server and my-domain/folder2 goes to another. ++++
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
Ameeno
just joined
Topic Author
Posts: 7
Joined: Sun Apr 29, 2018 1:25 am

Re: Multiple web addresses Behind router.

Thu Aug 08, 2019 11:54 am

I See,#

thanks for the guidance, So basically if i understand it correctly, The Mikrotik dst-nat firewall simply forwards WAN IP:port -> a lan device : port that i set up in the firewall.

SO it's down to my LAN devices (real or virtual) to route the packets internally and then back to the router to pass back?

Mikrotik will not do DNS/subdomain based routing on the router itself?

Who is online

Users browsing this forum: No registered users and 24 guests