It is necessary to configure collaboration with nginx, i. nginx acts as a proxy port 8001 and gives the node.js application. How in nginx to deny access to the application from port 8001 and leave only access by server_name ?
nginx
server { listen 80; server_name nodejs.local; location / { proxy_pass http://localhost:8001; 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; } }
proxy_set_header Host $host:$server_port;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;- Sergey