0

I got a node api on an azure virtual server. It was working fine on http -- but when I recently added the static web app react - the react deployed as a https link -- and now refuses to try and connect to the http node -- I am unsure how to configure the azure virtual server to become https - and I think also I need to rejiggle the server.js file here in my node to take on 8080 and 443?

I have used pm2 to keep the nodejs alive when I exit putty - and its got a switch of sorts with .env variables

I'm not sure how to further adapt it or how you'd make various ssl certificates in azure virtual machines with apache or for nodejs. Tried following something like this.

How to create an HTTPS server in Node.js?

enter image description here

localhost env is like this

enter image description here

my production env is like this -but do I need to make a port 8080 or 443 or both? enter image description here

The Old County
  • 89
  • 13
  • 59
  • 129
  • Hope this reference helps [SO](https://stackoverflow.com/questions/11744975/enabling-https-on-express-js), [MSDOC](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-secure-web-server) – Sampath Aug 23 '23 at 02:11
  • Thank you. Is this a common problem? Do I have recreate the virtual server to make a secure virtual server? It is a combination of changing the node code and creating a secure vm - like are these the security keys that get added to the node? – The Old County Aug 23 '23 at 16:16
  • Ah so it would be port 8443 not 443? is 8000+ reserved for just api? – The Old County Aug 23 '23 at 16:17

0 Answers0