Search code examples
node.jsnginxhttpsdnscloudflare

NodeJS + Nginx + Cloudflare


I use Node.js + Nginx + Cloudflare.

Node.js running at 3000 port.

Nginx have configuration:

location / { proxy_pass http://host:3000; proxy_set_header Host $host; }

This dosnt work! Why? If I dont pass through cloudflare(disable cloud) it is work but HTTPS doesn’t work and my ip is not hide!

if i use 8080 or 2052 port etc, from cloudflare list i have Error 1000!

How right use Node + Nginx + Cloudflare?


Solution

  • I understood my fault.

    At nginx i used a construction:

    location / {        
            proxy_pass http://domain:8880;
            proxy_set_header Host $host;
    }
    

    There are many redirect was in this configuration)

    New right configuration:

    location / {        
                proxy_pass http://IP:8880;
                proxy_set_header Host $host;
    }