how do I get a webpage to drop the :xxxx custom port in this url.

Started by richard378, September 05, 2025, 03:07:50 PM

Previous topic - Next topic
Hi,
I tried searching this with google but could not get anything to work like NAT port forward that is suggested.

I have a website on one of many computers at domain xxx.xxxxxxxx.com:xxxx and can't seem with unbound or NAT forwarding to show as xxx.xxxxxxxx.com without the :xxxx added at the end.  The computer has multiple sites on the machine and other machines have websites too.   I want to know a general way to do this without interference on the other machines say if another machine has the same port number and other websites with different port numbers but different website how do I configure both machines?

PS Google with Gemini can be confusing.  It give multiple answers depending on how it is asked and does not lead to adequate websites for reference is my problem in finding this answer.  Please help.

For example I do a unbound override alias from www.Axxxxx.com to xxx.Axxxxx.com->
AND do NAT forwarding ->
    WAN TCP/UDP * * xxx.xxx.xxx.xxx 443 (HTTPS) xxx.xxx.xxx.xxx xxxx
Plese help fix this: It goes to the www.Axxxxx.com website instead of the one I want with the port xxxx

You cannot do this with DNS (DNS does not know port numbers) and frequently you must change the configuration of the destination web site.

The way to go in most cases is a reverse proxy like the Caddy plugin for OPNnsense. Caddy can relay to different backends per IP address and port based on the hostname used to access the frontend on e.g. port 443.

If the application works without changing its configuration depends on the application. Some just blindly accept any URL thrown at them and work behind a proxy from the start. Some want a "base URL" setting that must be changed to the new hostname without the port. And some even require "trusted proxies" to explicitly listed.

HTH,
Patrick
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Your NAT is not working?

I gave up on doing this.  I was trying to run multiple Apache servers on different machines and I see that is it not doable.  I can't redirect nat to multiple machines, unbound only working on local network but not in the general external network. 

You can do that by using a reverse proxy. Assuming your Apache servers are running web/browser applications.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)