Translating apache config to nginx

Francis Daly francis at daoine.org
Thu Feb 20 09:04:05 UTC 2014


On Wed, Feb 19, 2014 at 05:35:46AM -0800, Grant wrote:

Hi there,

> The following seems to work fine:
> 
> location ~ ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps))
> {
>     deny all;
> }

That's probably work until you add "location ^~ /oops{}" and request
/oops/a.git

Not a problem; just a thing to be aware of when you use top-level regex
locations.

> But this causes a 403 during normal operation:
> 
> location ~ ^(?!installer)(\.?[^\.]+)$ {
>     deny all;
> }
> 
> Why is that happening?

What requests do you want to match that location?

What requests actually match that location?

Alternatively: what request do you make? What response do you expect? And
what is the regex above intended to do?

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list