I am new to nginx. I have tried proxy_pass many times but cannot jump outside the site. Can nginx request external links?
Currently there is an external API interface address: http://122.23.21.212/api/v2?args=others&argc=4
Now I want to implement this function:
When I access http://localhost/myapi?args=others&args=4, nginx actually accesses the http://122.23.21.212/api/v2?args=others&argc=4 interface internally. Please tell me. How does this need to be configured?
shell
server { ... location /myapi { proxy_pass http://122.23.21.212/api/v2?$request_uri; } ... }
Please help me, thank you
小伙看你根骨奇佳,潜力无限,来学PHP伐。