Hello everyone,
I’ve tried everything and searched the web as much as I could and finally need some help. What I want to do is simple and I feel I could easily do it with Apache or NGINX but have not been successful. I have a localhost address for example, 192.168.1.50. The localhost has multiple web UIs on different ports.
192.168.1.50:9117
192.168.1.50:8989
192.168.1.50:7878
192.168.1.50:32400
192.168.1.50:5000
Now, I want to allow access to these addresses publicly and I’m using cloudflare to forward the domain to my public address. As you all know, DNS is not responsible for redirecting towards a specific port only a public address such as an A record IPv4 address. I made attempts to do reverse proxy with NGINX and Apache2 but to no avail.
I’d like to forward these local addresses to a public domain like so in this example:
web1.example.com -> 192.168.1.50:9117
web2.example.com -> 192.168.1.50:8989
web3.example.com -> 192.168.1.50:7878
web4.example.com -> 192.168.1.50:32400
web5.example.com -> 192.168.1.50:5000
I’m not entirely sure if this is considered off-topic but I’m assuming I need to make some sort of modification to my Turris Mox firewall settings. I’ve always port forwarded which seems like an obvious answer but that did not work.
NOTE: I attempted to do reverse proxy through my local server and not the router.
Any help would be appreciated thank you.
EDIT:
/etc/apache2/sites-available/web4.example.com.conf
<VirtualHost *:80>
ServerAdmin example@example.com
ServerName web4.example.com
ServerAlias web4.example.com
ProxyRequests Off#ProxyPass / http://localhost:8080/ <Location /> ProxyPreserveHost On ProxyPass http://192.168.1.50:32400 ProxyPassReverse http://192.169.1.50:32400 </Location> # Uncomment the line below if your site uses SSL. # SSLProxyEngine On
</VirtualHost>
I attempted this on my local server and not on my Turris Mox router.