I have a Synology NAS, which has hard-coded ports 80 and 443 for their own reverse proxy implementation, but I want to use NGINX. ChatGPT suggested to change the defaults in the uHTTPd service, but I think it would be better to keep ports the same, but just forward them differently, similarly how this guy recommended here, at Post #9.
What you could do is not change the HTTPS port (which is 443) but make the firewall translate the requests from your custom ports to a 443. That is a bit cleaner than hacking the webif setup (which does not seem to contain any option for changing the port at first sight).
There are a few more ways to go about this, but I lean towards the following, in this setup:
I have a few firewalls/vlans, at 192.168.1.1 is my router, and at 192.168.4.1 is my NAS. They route properly and everything is fine.
I want to initialize my reverse proxy app (in docker), since 80 and 443 and taken by Synology, with no easy way of changing them, I want to change what my own reverse proxy app (NGINX) listens to, which let's say is 81 and 10443. Then I want the router to know that in my NAS Firewall/VLAN subnet 81 and 10443 are actually ports 80 and 443.
So I guess I need to forward them, not with traffic rules, but with port forwarding. Which I did both anyway to try, but didn't succeed.
Basically I mapped External IP/VLAN to Internal IP/VLAN 443 (Device/router LAN) to 10443 (NAS) to accept, same for 80 to 81, and I did the opposite where I mapped 10443 (NAS) to 443 (Device/router).
Nothing worked, of course I changed the listening ports in my docker configuration.
I would not be able to post my configs immediately, however please let me know if the direction I've looked at is the correct one, maybe give me an example of how it should properly be implemented with an example template, I will try to get back with the configs asap if they are needed.
I can't access ssh for now, but here are some images where I tried all of these in all combinations, both traffic rules and port forwarding and only port forwarding or traffic rules, since I wasn't sure, these are the examples only for 443:
port forwards:
traffic rules: