Welcome! Log In Create A New Profile

Advanced

Change default SSL port from 443 to other port?

Posted by gurabli 
Change default SSL port from 443 to other port?
April 27, 2016 04:16AM
Hi,
I'm quite new to Nginx, and up to now I'm using it as a reverse proxy for my home server. I read a lot and although I don't understand (yet) every option I use, I managed to put together a working Nginx configurations with SSL, and reverse proxy working.

Now here comes the part I just can't understand: I have a router running dd-wrt and configured to listen on port 443 for ssh connection, I use this to establish a socks5 tunnel to my home, and I deliberately use port 443 to "mask" ssh tunnel traffic as SSL.

The trick is, that for Nginx to work with SSL on port 443, I need to change the ssh port on the router to other then 443, and forward port 443 to the server I run Nginx. Then everything works.

I thought if I change the port to something other in Nginx config for ssl, let's say 5115, and I forward port 5115 to the server running Nginx, then it will work, but it doesn't. I have a valid certificate from Letsencrypt, if that matters anything. Please help me with this:

-- how can I change the default SSL port for Nginx?
-- do i compromise anything in terms of security if SSL is not using the default 443 port or it actually doesn't matter?

Here is my configuration file: http://pastebin.com/T26veNPU

Many thanks!
Re: Change default SSL port from 443 to other port?
May 08, 2016 02:03PM
Nobody? I'm really struggling with this, can't find out why it is not working.
Re: Change default SSL port from 443 to other port?
May 08, 2016 03:48PM
You should change the listen directive for ssl to some other port, use some port listen command/tool to see if nginx is listening after changing it.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Change default SSL port from 443 to other port?
May 08, 2016 03:55PM
Thanks.
"You should change the listen directive for ssl to some other port"
By this you mean to change the part:

listen 443 ssl;

to, for example:

listen 444 ssl;

Because I did this, of course. Or it should be done some other way?
Re: Change default SSL port from 443 to other port?
May 08, 2016 04:23PM
That is correct, make sure you use that port with the browser, https://bla:444/

---
nginx for Windows http://nginx-win.ecsds.eu/
[SOLVED] Re: Change default SSL port from 443 to other port?
May 10, 2016 02:00AM
itpp2012 Wrote:
-------------------------------------------------------
> That is correct, make sure you use that port with the browser,
> https://bla:444/

That was it, if I use different port then default 443 for SSL, then I need to specify this in the browser, like you said: https://bla:444/
Now it works great! Thank you for your help!



Edited 1 time(s). Last edit at 05/10/2016 02:01AM by gurabli.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 80
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready