Separated reverse proxy for different users

Ish Sookun ish at lsl.digital
Sun Sep 3 11:17:17 UTC 2017


Hi Ivy,

On 09/02/2017 11:53 PM, ivy wrote:
>   location / { 
>     try_files $uri $uri/ =404; 
>     auth_basic "restricted content"; 
>     auth_basic_user_file "/home/secure/.passwords"; 
>     auth_request_set $auth_status $upstream_status; 
> 
>      proxy_pass http://127.0.01:$rp_port 
>   } 

The above try_files directive would return only the files & directories
that are present withing the document_root. Any other request would meet
a 404 error. The requests do not seem to reach the proxy_pass.

If all requests are to be served by the proxy_pass, I suggest
commenting/removing the try_files directive. E.g.

  location / {

    auth_basic "restricted content";
    auth_basic_user_file "/home/secure/.passwords";
    auth_request_set $auth_status $upstream_status;

    proxy_pass http://127.0.01:$rp_port;
  } 	

Regards,

Ish Sookun


More information about the nginx mailing list