Microsoft Azure | Connect to website without port using 443

Gage 1 Reputation point
2022-10-15T00:43:04.433+00:00

VM Info:

  • Ubuntu 18
  • 2vcpus and 8gb ram
  • Running Express/HTTP (is that a problem?) server on Node

Currently, connecting to my website (ip: http://20.62.174.185) works but you have to include the port at the end of the website, even when using 443 and connecting using HTTPS.

I'm connecting to https://20.62.174.185 and it doesn't work but https://20.62.174.185:443 works. My NSG has HTTPS priority at 301, right above SSH at 300.

Edit: http://..*.185:443 works, not https
so it's a problem with not going to https at all

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,585 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,407 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Manu Philip 17,671 Reputation points MVP
    2022-10-15T06:43:56.027+00:00

    Looks like, you can correct it in Nginx config. open default file under the folder /etc/nginx/sites-enabled/ and add the contents similar to the following:
    I am not able to paste the code here. So, attaching it as a notepad

    250679-nginx.txt

    Copy the file to /etc/nginx/sites-available/ and restart Nginx to see if it helps

    ----------

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    0 comments No comments

  2. Lex Li (Microsoft) 5,322 Reputation points Microsoft Employee
    2022-10-19T06:22:50.247+00:00

    When the browser navigates to https://20.62.174.185, it uses SSL/TLS protocol to establish a connection to port 443.

    As in your case, you said that http://..*.185:443 works, we know that you mistakenly configured port 443 to work with HTTP, not HTTPS.

    You can find how to configure HTTPS sites from NGINX official sample, https://nginx.org/en/docs/http/configuring_https_servers.html

       server {  
           listen              443 ssl;  
           server_name         www.example.com;  
           ssl_certificate     www.example.com.crt;  
           ssl_certificate_key www.example.com.key;  
           ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;  
           ssl_ciphers         HIGH:!aNULL:!MD5;  
           ...  
       }  
    
    0 comments No comments