Hussain Mirahmadi Hussain Mirahmadi - 1 month ago 5x
HTTP Question

http to a Node server over https nginx website

Is it possible to have a http connection to a node.js server over a website which is generally secured by https ?

how do you suggest to combine a node connection with a website that is operating on https .


As already mentioned in the comments, it is useful to create a proxy to your node.js applications. A good tutorial is, for instance, from DigitalOcean:

In this tutorial, it shows that the host configuration can look like this:

server {
    listen 80;


    location / {
        proxy_pass http://APP_PRIVATE_IP_ADDRESS:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;

In this case, a reverse proxy to the port 8080 was created. Generally, this method can be used for every node.js application.

In your case: add the location block in your https server block and modify the route.