Answer the question
In order to leave comments, you need to log in
How to configure proxy_pass on nginx (Bitrix VM)?
It is necessary to transfer the domain.com/api/... request from the machine on which BitrixVM is installed (for example, 1.1.1.1) to another machine via the local network (for example, 192.168.123.123).
For example, when a request is made, the request http://1.1.1.1/api/method/arg/?param=1
must be executed on another machine http://192.168.123.123:80/api/method/arg/?param=1
Added location in the file /etc/nginx/bx/site_enabled/s1.conf the following location:
server {
...
location ~/api/(.*)$ {
proxy_pass http://192.168.123.123;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect default;
}
...
}
http://1.1.1.1/api/method/arg/?param=1
curl http://192.168.123.123/api/method/arg/?param=1
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