You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/23 01:12:59 UTC
[GitHub] [apisix] MrLightSpeed0 opened a new issue #2280: Route traffic through company proxy / firewall
MrLightSpeed0 opened a new issue #2280:
URL: https://github.com/apache/apisix/issues/2280
### Issue description
Hello,
I was able to start apisix and I am following this [page](https://github.com/apache/apisix/blob/master/doc/getting-started.md) to get started:
I was able to execute this and get answer:
`$ curl "http://127.0.0.1:9080/apisix/admin/services/" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'`
then I added the upstream and route as instructed to try to make a call to httpbin.org
however, when I ran: `curl -i -X GET "http://127.0.0.1:9080/get?foo1=bar1&foo2=bar2" -H "Host: httpbin.org"` I got 502 Bad Gateway. The log says following:
`2020/09/22 21:03:30 [error] 13826#13826: *3880616 connect() failed (101: Network is unreachable) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /get?foo1=bar1&foo2=bar2 HTTP/1.1", upstream: "https://34.194.129.11:443/get?foo1=bar1&foo2=bar2", host: "httpbin.org"`
then I knew that the traffic was blocked by the company proxy/firewall. However, I did set "http_proxy" and "https_proxy" etc. because I could curl -k https://httpbin.org directly and get results. somehow, the apisix doesn't honor the system setting. My question here is what do I need to do to config apisix to recognize the "http_proxy" and "no_proxy" settings? Thank you in advance!
### Environment
* apisix version (cmd: `apisix version`): 1.5
* OS: Ubuntu 18.04
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] MrLightSpeed0 commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
MrLightSpeed0 commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-706275290
@spacewander and @liuhengloveyou
exactly, first to answer your question, the forward proxy (if this term means different to you. I am sorry for the confusion) is a plain http proxy. Then second, I do have this set up as a global policy in my development environment as below:
http_proxy = http://myCompany:port
https_proxy = http://myCompany:port
no_proxy = 127.0.0.1, localhost, etc...
the use case is pretty simple, I am trying to make the example you have in your document work (also mentioned in posts above). and since i am trying this on a company machine. it needs to go thru the above mentioned proxy (it is the only way out for all our egress traffic. i believe all companies have this implemented. so it is very common set up). Please advise.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-706471374
@MrLightSpeed0
> i believe all companies have this implemented.
Yes. My company requires a forward proxy to access inner infra. The solution they told me and I have been using is to set up a global proxy in front of their forward proxy, because not all software support the proxy environments.
Since your company's proxy supports HTTPS, I guess it is a HTTP CONNECT proxy. To run Nginx as a client support HTTP CONNECT, we need to modify Nginx's source code. Since the issue is only happened in the development environment, personally I don't think it will be an urgent task.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] liuhengloveyou edited a comment on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
liuhengloveyou edited a comment on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-699587058
apisix does not load http_proxy。
mybe, You can achieve the same effect with [proxy-rewrite](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/proxy-rewrite.md), pointing the upstream proxy information to your proxy.
try it out?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-704172006
@MrLightSpeed0
How we can use the forward proxy depends on the type of forward proxy your company using.
What kind of proxy you are using? Plain http or https or socks?
Since apisix doesn't support forward proxy currently, it would be simper if you can set up a global proxy in your development environment.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] liuhengloveyou commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
liuhengloveyou commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-706467734
> Hi Maybe I didnt explain clearly... I dont think the proxy-rewrite will solve the issue. basically, I am calling from inside a company, which has a forward proxy to access outside world. this is a typical set up for pretty much all companies. while:
> "caller ---> https://httpbin.org/get?foo1=bar1&foo2=bar2" works
> the "caller --->http://127.0.0.1:9080/get?foo1=bar1&foo2=bar2 --->https://httpbin.org/get?foo1=bar1&foo2=bar2" should also work.
> This is the basic functionality for API roting, it should be provided. Hope what I explained made sense to you. If you think proxy-rewrite works for apisix, please share with an example on how I should use it in this case. Thank you.
I understand the effect you want. apisix and nginx are not supported by default.
The reason I said proxy-rewrite might be worth a try is that some http-proxy protocols are simpler and only require a header or request parameters.
You need to try to see if you can request your company's proxy protocol by rewriting it.
Alternatively, apisix may need to implement a plug-in that supports the standard http-proxy protocol. @membphis
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-704010247
> You can achieve the same effect with [proxy-rewrite](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/proxy-rewrite.md)
can you show us an example of this case? if it can work, it should be helpful for @MrLightSpeed0
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] liuhengloveyou commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
liuhengloveyou commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-699587058
see it now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] MrLightSpeed0 commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
MrLightSpeed0 commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-699743662
Hi Maybe I didnt explain clearly... I dont think the proxy-rewrite will solve the issue. basically, I am calling from inside a company, which has a forward proxy to access outside world. this is a typical set up for pretty much all companies. while:
"caller ---> https://httpbin.org/get?foo1=bar1&foo2=bar2" works
the "caller --->http://127.0.0.1:9080/get?foo1=bar1&foo2=bar2 --->https://httpbin.org/get?foo1=bar1&foo2=bar2" should also work.
This is the basic functionality for API roting, it should be provided. Hope what I explained made sense to you. If you think proxy-rewrite works for apisix, please share with an example on how I should use it in this case. Thank you.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] membphis edited a comment on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
membphis edited a comment on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-704010247
> You can achieve the same effect with [proxy-rewrite](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/proxy-rewrite.md)
can you show us an example of this case? if it can work, it should be helpful for @liuhengloveyou
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] moonming commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
moonming commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-698113193
@liuhengloveyou please take a look
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] github-actions[bot] commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-939270261
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] moonming commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
moonming commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-698113193
@liuhengloveyou please take a look
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] github-actions[bot] closed issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #2280:
URL: https://github.com/apache/apisix/issues/2280
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander edited a comment on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
spacewander edited a comment on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-706471374
@MrLightSpeed0
> i believe all companies have this implemented.
Yes. My company requires a forward proxy to access inner infra. The solution they told me and I have been using is to set up a global proxy in front of their forward proxy, because not all software support the proxy environments.
Since your company's proxy supports HTTPS, I guess it is a HTTP CONNECT proxy. To run Nginx as a client supports HTTP CONNECT, we need to modify Nginx's source code. Since the issue is only happened in the development environment, personally I don't think it will be an urgent task.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] github-actions[bot] commented on issue #2280: Route traffic through company proxy / firewall
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #2280:
URL: https://github.com/apache/apisix/issues/2280#issuecomment-927098618
This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org