Score:0

nginx location “~*” and "~" modifier not working in macOS

vn flag
Omi

I have the following nginx configuration:

server { 
  listen 80; 
  server_name localhost; 
  root /nginx-root/html/;

  location ~ \.(png|jpg|jpeg)$ {
    return 200 "OK1";
  }

  location ~* \.(png|jpg|jpeg)$ {
    return 200 "OK2";
  }
}

then I enter "curl http://localhost/nginx.PNG", and expected return "OK2", but actually is "OK1", Is there something wrong with my computer configuration?

Michael Hampton avatar
cz flag
You aren't using a case sensitive filesystem.
Omi avatar
vn flag
Omi
Yes, thanks for this
br flag
Well, it's not about filesystem, but OS. See https://trac.nginx.org/nginx/ticket/87#comment:4 for workaround and possible problems.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.