Answer the question
In order to leave comments, you need to log in
How to redirect some requests to another port?
Nginx is installed on the VM. It is necessary to redirect some of the requests to another port. I created the /etc/nginx/conf.d/example.conf file
and here it is
server{
listen 443;
location /findByFId {
proxy_pass http://хх.ххх.хх.хх:4444/;
proxy_redirect off;
}
}
Answer the question
In order to leave comments, you need to log in
If this part of the requests is to the same address, then this can be done using the upstream block, and specify not a specific ip/port in proxy_pass, but a group of servers.
Different servers in a group may not necessarily be different servers, but simply different ports on the same ip.
more details in the documentation: https://nginx.org/ru/docs/http/ngx_http_upstream_m...
If to different addresses, create different locations that will receive the necessary requests and proxy to the necessary ports.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question