What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Any way in the merlin router to redirect port 80 to 443 ?

vw-kombi

Regular Contributor
Hi,
I have nginx running on a server on my lan.
My router currently forwards ONLY port 443 to the nginx server which does its reverse proxy thing to the back end services.
I use remote subdomains for access and my own domain.
Remotely, you have to therefore do https://subdomain.example.com to get access, if you leave off the https, you cant connect.
As a test, in nginx I have added a reroute on port 80 to change to ssl :

server {
listen 80;
server_name _;
return 301 https://$host$request_uri;
}

And now if I open port 80 and redirect it to the nginx server, remote users can just key in subdomain.example.com and they get in fine.

Questions :
Is it a good idea to allow port 80 like this ? Is it safe ?
Is there a way in the router instead to do this redirect so i dont have the packets heading inside my lan ?
I have skynet, absolution installed if that helps.

Thanks.
 
What you have set up is secure and simple IMO.

Insecure packets can enter your LAN but they only thing they can execute this this;
Code:
server {
listen 80;
    server_name _;
    return 301 [URL]https://$host$request_uri;[/URL]
}

So no worries.

The only other option would be to run a webserver like lighttpd on the router that listens on the WAN:80 (available via entware) and have it do the exact same redirect.




Sent from my iPhone using Tapatalk
 
Thanks JDB for the vote of confidence there. I only have 42MG ram left on the router showing so it may be a bit much to add the web server on there also - but glad to know that is an option to remove them from the lan altogether.
 
setup a port forwarding rule for incoming port 80 to hit your web sever ip on 443. pretty straight forward. You may have issues though for people hitting it expecting http and getting https instead.

You'd be better using custom ports instead.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Members online

Back
Top