Tell me, is there an option to forward on the microtic 2 times 80 port on different hosts? For example host1.ru and host2.ru? Or do you have to buy another IP separately? I can't hang both hosts on the same server.
- oneIf we are talking about web servers, then you can use the Mikrotikovsky web proxy Multiple Web Servers - Andrew Hobbit
- I'm afraid I will not only have to push port 80 as a result ... - DemoriaN
- your case? wiki.mikrotik.com/wiki/Hairpin_NAT - spectre_it
3 answers
You can do this by some sort of rules, including L7.
For example, if you do not exactly plan to use https, then you can match the http header, search for a host in it and redirect it depending on this. (more info here: http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/L7 )
Of the minuses - it will be very resource-intensive, and if the microtic is from the SOHO class, for example, the 951st, it may not be able to cope with when the sites become popular.
- oneIn general, I would use nginx in such a situation (for example) as a proxy on one of the hosts, then there will be no problems with https. - Stalker
As an option to do so:
host1.ru do host1.ru 80 to the local address.
host2.ru:8080 we do a host2.ru:8080 on 80 to another local address.
And how do you imagine that? In the morning port 80 will be forwarded to host1.ru, and in the evening host2.ru? This is TCP, it doesn’t know anything about the upstream HTTP protocol. The only option is to put some ngingx or transparent proxy, which will get you content from different hosts depending on the HTTP host in the request.
- I can assume that probably with nginx the best option ... - DemoriaN