Search code examples
nginxserverlocation

How to extend folder location on Nginx?


I am getting error while compiling site configuration:

location ~ /la(.*) {}

location /la {}
nginx: [emerg] pcre_compile() failed: nothing to repeat in "/la(*.)" at "*.)"

I need to urls like /las-Vegas works on first location, and links like /la/title on second. I have tried use quotes in regex, but this won’t help. Maybe some other way to do that?


Solution

  • In config file ~ /la(*.) {} is set mistakainly. Change it to:

    ~ /la(.*) {}