Answer the question
In order to leave comments, you need to log in
Nginx redirect requests that go to localhost to remote API?
I need requests. to localhost on some port redirect to remote APIs.
In this case, the problem is with throttle( limit requests per second). You need to make requests to the vk API, and you need to set a limit on outgoing requests so as not to exceed the limit. I decided to install NGINX, send requests to localhost / some URL, catch in inginx and throttle for this.
How to configure it, it doesn’t work,
It seems to be
http{
server {
listen localhost:8085;
location /some/path/method {
proxy_pass http://api.vk.com;
} }}
Answer the question
In order to leave comments, you need to log in
Forwarding a GET request is written correctly, try proxying to your other host and look at the access logs there. To see what nginx does, here is a good description of how to debug https://serverfault.com/a/435575
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question