How to redirect a subdomain to ip:<port>?

I'm looking to redirect requests for to at the router level.

This is for Home Assistant setup. I have SSL certificates and everything already working but the last thing I'm hoping to do is not have to type the port number when accessing the server.

It's unclear whether this is even possible. This thread seems to have the answer.

It points to the uhttpd config file settings. However, the original poster said he got it working but didn't specify what settings he added to the config and it's not obvious to me what to do after reading the docs.

Maybe @Flamingi is still around to answer? If not, can someone else point in the right direction?

Thanks! :muscle:

So long as the device sits on another VLAN, you can do this with a simple NAT, tbh.

Thanks for the comment @lleachii. That would be awesome. Can you expand a bit?
If it were simple for me I wouldn't have asked. :grinning:


Assuming your LAN == and router is

You server is e.g. and it's IP is

  • Using any RFC1918 address you're not using (e.g. make a NAT
    • If from LAN to at 80/tcp
    • Redirect to 8123/tcp

:spiral_notepad: I should note, in any case, you have to traverse the router/firewall for anything to work, so this is why I suggested a simple NAT rule.

Also, this is why the device cannot be as you would not cross a network boundary for the OpenWrt to handle the traffic...unless the the OP of the other thread did some kinda Ethernet filtering to accomplish it (which still means it passed interfaces on said device).

OK, I see what you are saying.
That would take a lot more changes to my setup.

I guess I'll give up on this for now. Thanks.