Hi i'am new in mikrotik router, how to configure if i only have one Public IP, but user can access different/multiple domain from internet, with condition i have multiple webserver behind router, as shown below. Thanks for this help.
global
log /dev/log local0
log /dev/log local1 notice
# log 127.0.0.1 local0
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
option httpclose
option forwardfor
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
# input redirect
frontend http-in
bind *:80
# Define a rule to use based on domain name
acl is_www hdr_end(host) -i www.home.com
acl is_cam hdr_end(host) -i cam.home.com
acl is_ups hdr_end(host) -i ups.home.com
acl is_webmin hdr_end(host) -i webmin.home.com
# Redirect to correct server based on rule to use
use_backend srv_www if is_www
use_backend srv_cam if is_cam
use_backend srv_ups if is_ups
use_backend srv_webmin if is_webmin
default_backend default
# List of servers to use based on redirect
backend srv_web
server Local 192.168.1.30:80
backend srv_cam
server Local 192.168.1.50:8080
backend srv_ups
server Local 192.168.1.20:80
backend srv_ups
server Local 192.168.1.15:10000
backend default
server Local 192.168.1.30:80
How will RouterOS differentiate between domains in order to know where to forward the packets?Hi,
You just need to write Destination-nat for those servers with different port number and specify the DNS records in your ip/dns/static for those two servers then you can open it from outside with one public ip address. (You just need to know about destination nat and PAT-port address translation concept)
Best regards,