NGINX as a forward proxy

I am currently using "tinyproxy" for some outgoing connections, that positively need to use a proxy. I am also using NGINX as a reverse proxy, mostly as an SSL endpoint and multiplexer, for some incoming connections.

I would like to get rid of "tinyproxy", and have just one running service instead of two.

Officially, NGINX cannot work as a forward proxy, but there exists an out-of-tree extension (ngx_http_proxy_connect_module), that can provide this functionality.

Would it be possible to add this module to OpenWrt? Do you think it could be relatively easy for somebody to build such module themselves?


server {
    listen       8888;

    location / {
        resolver x.x.x.x; # might be needed
        proxy_pass $scheme://$http_host$request_uri;

give a try now

1 Like

Thanks... but I also need HTTPS.

You need build custom nginx opkg package with ngx_http_proxy_connect_module.
Build custom package for OpenWRT:
Build ngx_http_proxy_connect_module for x86:

1 Like

Thanks, I will try this!