Welcome! Log In Create A New Profile

Advanced

location ~* .(a|b|c)$ {} caused an error

Sophie Loewenthal
December 04, 2017 11:52AM
Hi,

When I put this location block for case insensitive matching into the vhost produced an error.

nginx: [emerg] location "/" is outside location ".(jpg|jpeg|png|gif|ico|css|js)$" in /etc/nginx/sites-enabled/example.conf:13

My vhost has this:

server {

location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
expires 65d;

location / {
allow all;
limit_req zone=app burst=5;
limit_rate 64k;
}

}

Did I misread the http://nginx.org/en/docs/http/ngx_http_core_module.html#location doxs?

Quote "A location can either be defined by a prefix string, or by a regular expression. Regular expressions are specified with the preceding “~*” modifier (for case-insensitive matching),"


Thanks, Sophie.




_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

location ~* .(a|b|c)$ {} caused an error

Sophie Loewenthal December 04, 2017 11:52AM

Re: location ~* .(a|b|c)$ {} caused an error

Ian Hobson December 04, 2017 12:58PM

Re: location ~* .(a|b|c)$ {} caused an error

Sophie Loewenthal December 04, 2017 01:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 99
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready