Can't configure proxy server with nginx, how to do it correctly?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
23 views
How to configure proxy server nginx (https request) to the transmitted data node.js the server on port 3000, and get a response from node.js and display to the user?

Now have done so, but the result is like zero:
nginx.conf
server { # IP, which we will listen listen 443 ssl; server_name mysite.ru; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; keepalive_timeout 60; ssl_certificate __here is the address to the certificate__/mysite.EN.crt; ssl_certificate_key __here is the address to the certificate__/mysite.EN.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers directives "HIGH:!RC4:!aNULL:!MD5:!kEDH"; add_header Strict-Transport-Security 'max-age=604800'; location / { # IP and port on which hangs node.js proxy_pass http://127.0.0.1:3000/; "proxy_redirect" off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass_header Set-Cookie; } }


node.js

var http = require('http'); http.createServer(function (req, res) { console.log('Test'); Res. writeHead(200, {'Content-Type': 'text/plain'}); Res. end('Hello World\'); }).listen(3000); console.log('Server running at port 3000');
by | 23 views

1 Answer

0 like 0 dislike
If there is Vesta, try to change config, add the line listen IP address of the server that would have turned out something like
listen 8.8.8.8:443 ssl;
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,253 users