Answer the question
In order to leave comments, you need to log in
Recommend a proxy server for request mapping
Situation:
Application A provides a web service available at srv1.ru:80/Address1.
These addresses are registered with Third Party System B and cannot be re-registered.
After refactoring, application A changed the web service address to srv1.ru:8080/Address2
I want to put a proxy server between A and B that will map both addresses to the actual web service address.
At the same time, I want the proxy to be asynchronous (for example, nginx), lightweight, and support wildcards (i.e., the '*' sign in the path).
I would be happy with an example config for nginx.
Answer the question
In order to leave comments, you need to log in
In the simplest case, the config is
server {
listen 80;
server_name srv1.ru;
location /Address1 {
proxy_pass srv1.ru:8080/Address2;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Here everything is written in all details: nginx.org/ru/docs/http/ngx_http_proxy_module.html
In short, you need to set the location with proxy_pass, and if necessary (if the uri changes) with rewrite. If many identical requests go to an external service, you can additionally set proxy_cache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question