Nginx Location Matching Documentation Update

kustodian nginx-forum at nginx.us
Thu Oct 18 11:24:14 UTC 2012


I would recommend that the documentation for location matching is updated
http://wiki.nginx.org/HttpCoreModule#location, explicitaly the example. It
should contain a conventional strings besides the root '/' of the site:

location  = / {
  # matches the query / only.
  [ configuration A ] 
}
location  / {
  # matches any query, since all queries begin with /, but regular
  # expressions and any longer conventional blocks will be
  # matched first.
  [ configuration B ] 
}
location ^~ /images/ {
  # matches any query beginning with /images/ and halts searching,
  # so regular expressions will not be checked.
  [ configuration C ] 
}
location /media/ {
  # matches any query beginning with /media/ and continues serching,
  # so regular expressions will be checked. This will be matched only if
  # regular expressions don't find a match
  [ configuration D ] 
}
location ~* \.(gif|jpg|jpeg)$ {
  # matches any request ending in gif, jpg, or jpeg. However, all
  # requests to the /images/ directory will be handled by
  # Configuration C.   
  [ configuration E ] 
}

I don't know who could I ask about this, but I think that it's important
that all 4 explained steps in the documentation are covered by the example.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,231966,231966#msg-231966



More information about the nginx mailing list