B
B
Boris Yakushev2016-09-01 19:12:38
linux
Boris Yakushev, 2016-09-01 19:12:38

Https to localhost ubuntu?

Good afternoon.
I needed to set up https, did everything according to the manual, but when I go to https://example.dev it opens

Apache2 Ubuntu Default Page

The manual also says:
The HTTPS protocol works on port 443, so if the server is behind a gateway, then you need to forward this port on it.

If I understand correctly, then the default page opens precisely because of port 443.
How to forward this port?
Thanks everyone for the advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cool Admin, 2016-06-30
@sajor2006

You need something like this.
##### fwmark ######
iptables -t mangle -F
iptables -t mangle -X
iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -m mark ! --mark 0 -j RETURN # if already set, we're done
iptables -t mangle -A PREROUTING -i wan1 -j MARK --set-mark $MARK_WAN1
iptables -t mangle -A PREROUTING -i wan2 -j MARK - -set-mark $MARK_WAN2
iptables -t mangle -A POSTROUTING -o wan1 -j MARK --set-mark $MARK_WAN1
iptables -t mangle -A POSTROUTING -o wan2 -j MARK --set-mark $MARK_WAN2
iptables -t mangle -A POSTROUTING -j WAN1 --save-mark
##### NAT ######
iptables -t nat -F
iptables -t nat -X
for local in "list of internal IP/netmask combos"; do
iptables -t nat -A POSTROUTING -s $local -o wan1 -j SNAT --to-source "IP"
iptables -t nat -A POSTROUTING -s $local -o wan2 -j SNAT --to-source "IP »
done
And the rules:
ip rule add fwmark $MARK_WAN2 pref 2000 lookup wan2
ip rule add fwmark $MARK_WAN1 pref 2001 lookup wan1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question