Answer the question
In order to leave comments, you need to log in
Is it safe to use http proxy_pass in such a scheme?
There are 3 NodeJS applications on the server: public, admin, api. Nginx is configured as a reverse proxy so the workflow looks like this:
server {
listen 80 default_server;
listen[::]: 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name example.com;
ssl on;
ssl_certificate / home / example.com / ssl - bundle.crt;
ssl_certificate_key / home / example.com / private - key.key;
ssl_prefer_server_ciphers on;
root /var/www/html;
index index.html index.htm index.nginx - debian.html;
location / {
proxy_pass http://localhost:4444;
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;
}
location / api {
proxy_pass http://localhost:5555;
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;
}
location / admin {
proxy_pass http://localhost:7777;
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;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question