Re: most efficient way to return on everything but a single directory?

2016-11-07 Thread Igor Sysoev
On 08 Nov 2016, at 04:14, Jonathan Vanasco wrote: > I'm doing a quick audit on an nginx deployment and want to make sure > something is implemented correctly > > We have a handful of domains that redirect http traffic to https. > > we used to do this, which is very efficient: > > sever

most efficient way to return on everything but a single directory?

2016-11-07 Thread Jonathan Vanasco
I'm doing a quick audit on an nginx deployment and want to make sure something is implemented correctly We have a handful of domains that redirect http traffic to https. we used to do this, which is very efficient: sever { listen 80: server_name example.

Re: auth_basic within location block doesn't work when return is specified?

2016-11-07 Thread Igor A. Ippolitov
Changed own example in the last moment and made a mistake: try files should address non existent file and then do an internal redirect. E.g. try_files nosuchfile.txt @ret; Only the last argument may be a redirect. On 07.11.2016 11:37, Igor A. Ippolitov wrote: This behavior is cause by gen

Re: auth_basic within location block doesn't work when return is specified?

2016-11-07 Thread Igor A. Ippolitov
This behavior is cause by general request processing logic. You may look at ngx_http_core_module.h which defines request processing phases. You may notice that a rewrite phase ('return' acts as a rewrite, actually) is run before access phase. So you have your request returned before access rules