Unable to access server hosted on VM via https - azure

I have a server running on ubuntu installed on azure vm. I am able to access the server via http, however when I am trying to connect via https, I am getting error: ERR_CONNECTION_REFUSED
I have added inbound rule to allow port 443, but still I am facing the issue.

To secure the websites on azure VM, you need to inject the SSL certificate into the VM and configure your web server with a TLS binding. Read this Tutorial: Secure a web server on a Linux virtual machine in Azure with TLS/SSL certificates stored in Key Vault. Also, you need ensure the port 443 is allowed in the inbound firewall of Azure VM.
When you have done it, you can check if the port 443 is listening on the Azure linux VM via netstat -tulpn | grep LISTEN, see How to check if port is in use on Linux or Unix
Let me know if you have any question.

Related

Configure SSL on NGINX reverse proxy on GCP VM

I have a GCP VM instance running a NodeJS server and it has a Nginx reverse proxy configured that allows me to connect with the NodeJS server over HTTP. The server is also accessible through a domain name (The Domain was purchase from Google Domains and I did not explicitly buy a SSL certificate)
I want to configure HTTPS on this VM instance.
I tried to use certbot and follow the instructions here https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx
but I still cannot connect to my NodeJS server over HTTPS.
Please note: HTTP traffic works fine when connecting through IP and domain name.
Fixed this.
Turns out, that the firewall was blocking connections to port 443.
For readers:
On GCP VM make sure firewalls are configured correctly at 3 places.
GCP Networking Firewall should be configured to allows http/https/SSH/etc
Your VM should be set with proper GCP Firewall tags so that your GCP Firewall configuration is applied to your VM.
Your OS Firewall should be configured to allow the traffic you want.

Azure VM Port for Localhost

So I'm using an Azure VM that has a public IP address, and I've opened an inbound port, let's say it's 5555.
What I'm trying to do now is to run an application on the VM that has an API via localhost, also with the port 5555. I'm calling it then with public_ip:5555/api/...
Since I was not able to connect to the application from outside, is there something missing here? Most tutorials and resources I've found just mentioned opening the port.
Thanks.
Take a look at Azure's IP Flow Verify utility, which will check your NSG rules to ensure traffic can reach your VM. https://learn.microsoft.com/en-us/azure/network-watcher/network-watcher-ip-flow-verify-overview
If traffic is reaching your VM, check your host firewall and then your application server logs.

Cannot connect to my website running on Azure VM

I cannot seem to connect to my website running on Azure VM. I have looked through every single Azure docs.
I allowed incoming connections to port 80 per documentation:
I have a very basic Hello World nodejs app listening on port 80 (i confirmed this app works locally my own system):
I am attempting to connect to the site via the Public IP assigned to me that i see in Azure Portal:
The problem is any attempt to connect to 40.XXX.XXX.230:80 in Chrome simply times out.
I am new to VM's but i think something is wrong with port forwarding?
Another thing to check:
Remote desktop into the virtual machine, and confirm that the virtual machine's local firewall allows incoming HTTP and HTTPS connections.

Access Ubuntu Server VM on Azure

I've setup an Ubuntu Server on Azure. On this server, an application is running on port 3000. I want to access this application external. Azure tells me my server has public ip 40.68.XXX.XXX.
When I ping this IP, there is no response, despite ssh works when connecting to this IP-address.
I want to access 40.68.XXX.XXX:3000 external, does somebody know how to get this work?
Yes, you need to open up a port on the Network Security Group (NSG) and open up the port on your firewall (on the VM itself).
Easiest way to open the port is using the portal:
https://learn.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-nsg-quickstart-portal

Cannot access Neo4j browser on a Windows Server

I have a Windows Server 2012 virtual machine provisioned on Azure. I installed Neo4j server on this virtual machine and I'm accessing the Neo4j browser on localhost:7474.
However I cannot access the browser outside using my virtual machine's public IP e.g <machineIP:7474>
Here's what I have done so far:
In the Azure portal, I added inbound rules for the NSG to allow http and https ports 80 and 443 (I have done the same on a Linux virtual machine also hosted in Azure and I can access the browser just fine)
I also added an inbound rule in Windows Firewall to allow Port 80 and 443 as well
What possibly blocks me from accessing the virtual machine's IP from the outside?
You have to add TCP port 7474 to the firewall in the Azure portal:
change your neo4j-server.properties
set
org.neo4j.server.webserver.address=0.0.0.0
To remotely access Neo4j installed on a Windows VM in Azure, these are the changes you'll need to make:
In the Azure portal, add TCP port 7474 to the Endpoints of your Windows VM
On your Windows VM, in the Windows Firewall Advances Security, add a new Inbound Rule for port 7474
Change the conf/neo4j.conf and uncomment this line:
org.neo4j.server.webserver.address=0.0.0.0
Note: In case you also want full access to Neo4j's browse interface including Bolt, then also add port 7687 both in the Azure Endpoints and the Windows Firewall.

Resources