Is it possible to configure socket connection(not web) in Nginx reverse proxy server

Sergey A. Osokin osa at freebsd.org.ru
Mon Jun 27 14:11:58 UTC 2022


Hi there,

hope you're doing well.

On Mon, Jun 27, 2022 at 12:47:04AM -0400, mikecon wrote:
> 
> stream {      
>     server {
>         auth_basic  off;

The auth_basic directive is a part of http_auth_basic module, [2] so it's
not related to a stream modules family.

>         proxy_ssl off;

The proxy_ssl directive is off by default, [2], can be safely removed.

>         listen     80;
>         #TCP traffic will be forwarded to the proxy_pass  #proxy_pass
> 3.111.69.167:9988;
>         proxy_pass 127.0.0.1:8899;        
>     }
> }
> 
> I want to open Port 80 and Internally proxy pass to my server,
> currently getting 400 status code, when I do this, and its not passing my
> request to my server

Other directives should work well.  Here's the list of questions:
1. how did you test it?
2. have you checked nginx log files?
3. in case of 400 error, that seems like a web-server (not nginx) replied
   with that error, any chance to check log files on that side?

References:
1. https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic
2. http://nginx.org/ru/docs/stream/ngx_stream_proxy_module.html#proxy_ssl

-- 
Sergey A. Osokin



More information about the nginx mailing list