Multiple URL parameters in the same location directive.

Jonathan Matthews contact at jpluscplusm.com
Sun Oct 28 14:37:41 UTC 2012


On 28 October 2012 03:59, Quintin Par <quintinpar at gmail.com> wrote:
> Hi all,
>
> I have some URL patterns that follow the same directive specifications.
>
[snip]
> Now I have written separate directives for all of these URL patterns.
> How can I combine them into one line?
>
> Can I do this?
>         location /robots.txt, sitemap.xml, ~*.xml {

Not quite.

You'll need to use a regular expresion in your location, as detailed
at http://nginx.org/r/location and
http://wiki.nginx.org/HttpCoreModule#location

I find the wiki documentation on this specific topic to be clearer and
more useful.

Jonathan
-- 
Jonathan Matthews // Oxford, London, UK
http://www.jpluscplusm.com/contact.html



More information about the nginx mailing list