apisix icon indicating copy to clipboard operation
apisix copied to clipboard

help request: how to proxy_pass url such as "baidu.com" ?

Open chenyongzhi001 opened this issue 3 years ago • 2 comments

Description

server_name www.a.com location /api/ { proxy_pass https://www.b.com/; } how to config that in apisix-dashboard ? use response-rewrite or proxy-rewrite ?

Environment

  • APISIX version (run apisix version):
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

chenyongzhi001 avatar Sep 21 '22 03:09 chenyongzhi001

and how to config upstream ? just 127.0.0.1: 80 or what ?

chenyongzhi001 avatar Sep 21 '22 03:09 chenyongzhi001

and how to config upstream ? just 127.0.0.1: 80 or what ?

I didn't understand. You can configure upstream to any accessible address. please refer to getting-start.

guitu168 avatar Sep 21 '22 05:09 guitu168

As a reminder, do not use baidu.com as a test upstream, they will have some policies to restrict proxy access.

tzssangglass avatar Sep 22 '22 03:09 tzssangglass

@chenyongzhi001 you can use proxy-rewrite to achieve this, please reopen the issue if you have more questions.

shreemaan-abhishek avatar Sep 06 '23 05:09 shreemaan-abhishek