J Khan
unread,Jun 11, 2025, 10:05:50 AMJun 11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openresty
Hello, I have a situation where the API client is making a REST API call, which is received by OPENRESTY, which then needs to forward it to an HTTP proxy using CONNECT, which then forwards the HTTP request to the Target API Server. I am having no luck in finding ways for OPENRESTY or NGINX to act as a PROXY Client to the Proxy Server. I find no way of specifying a proxy server and port. If I just use proxy_pass from openresty -> proxy server, it uses GET/POST/or whatever and doesn't use CONNECT which the Proxy Server is expecting. To me it seems like it should be a very common use case, but I can't seem to find a solution for it. I know that stream can allow a client to send CONNECT request and NGINX can act as a dumb proxy BUT in this case OPENRESTY/NGINX need to be the client for the proxy. I am afraid that I would have to use lua_http library but that would block the worker thread and kill all benefits of NGINX.
Any advice?