Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Run two public servers on one IP with OPNSense
« previous
next »
Print
Pages: [
1
]
Author
Topic: Run two public servers on one IP with OPNSense (Read 520 times)
4yi89u
Newbie
Posts: 7
Karma: 0
Run two public servers on one IP with OPNSense
«
on:
April 24, 2024, 09:17:19 am »
Please help me out, I spent the last two days swearing at my computer and following various HAProxy guides with no success. So I figured I'd ask for some help as I am making zero progress in achieving this goal.
Here's my struggle:
I have an XCP-NG box running OPNSense in a VM at 14.0.0.1:1776. I have been running a public facing Server1 for some years with great success, but now I need to run another server.
Server1 is located at 14.0.0.11 and server 2 is located at 14.0.0.22
I want server1.dogs.com to point to 14.0.0.11 and for server2.cats.net to point to 14.0.0.22. I want it to be accessible from WAN.
Both domains are on cloudflare.
So I figure I need some middle man server or plugin to point wan traffic to that will look at it and say: this visitor is going to server1.dogs.com so they are routed to 14.0.0.11 and this other visitor is going to server2.cats.net and he needs to go to 14.0.0.22.
I don't need this middle man to do anything with SSL or load balancing or . I don't care about having SSL on LAN. The servers I have running handle their own SSL. I just need it to see the URL that a visitor is going to and route them to the proper internal IP.
Please advise, what's the easiest way to do this?
I'm open to running a plugin or another VM or really anything.
Logged
Patrick M. Hausen
Hero Member
Posts: 6854
Karma: 575
Re: Run two public servers on one IP with OPNSense
«
Reply #1 on:
April 24, 2024, 09:25:56 am »
The Caddy plugin (os-caddy) will probably do what you need. Note that switching the destination based on a hostname/FQDN works for HTTP/HTTPS only and not for arbitrary applications that don't support this concept (host header, SNI).
HTH,
Patrick
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
4yi89u
Newbie
Posts: 7
Karma: 0
Re: Run two public servers on one IP with OPNSense
«
Reply #2 on:
April 27, 2024, 09:22:24 am »
Thanks, that worked half-way.
I got my second server working. But now my first server which is a docker contained nextcloud refuses to resolve.
edit: never mind figured it out
had to point to my apache port under handlers
WOOOHOOO!!!
edit2:
I forgot to say, THANK YOU!
«
Last Edit: April 27, 2024, 10:18:29 am by 4yi89u
»
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Run two public servers on one IP with OPNSense