Forum: NGINX A little syntax help, please

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2107d4e4b544f904194507258a40cac1?d=identicon&s=25 John Moore (Guest)
on 2008-11-21 20:14
(Received via mailing list)
Can someone point out to me, please, how I can group a bunch of pages in
a location block, so they all get the same treatment? Let's say I have
'/somePage.htm', '/anotherPage.htm', and '/yetAnotherPage.htm'. I
thought the following would work, but it doesn't. Am I close? TIA


        location /(somePage|anotherPage|yetAnotherPage).htm) {
            include /etc/nginx/admin.conf;
        }
F850da95064ee4b7eae9caff255f6224?d=identicon&s=25 Almir Karic (Guest)
on 2008-11-21 21:01
(Received via mailing list)
what you want are regex locations, see
http://wiki.codemongers.com/NginxHttpCoreModule#location
2107d4e4b544f904194507258a40cac1?d=identicon&s=25 John Moore (Guest)
on 2008-11-22 15:03
(Received via mailing list)
Almir Karic wrote:
>>
>>        location /(somePage|anotherPage|yetAnotherPage).htm) {
>>            include /etc/nginx/admin.conf;
>>        }
>>
>>
>>
>
>

Hmm, that was actually my attempt at using a regex location. I amended
it to the following, still without luck:

  location ~/(somePage|anotherPage|yetAnotherPage).htm)${
           include /etc/nginx/admin.conf;
       }

I'm hoping someone can point out the error of my ways.
2107d4e4b544f904194507258a40cac1?d=identicon&s=25 John Moore (Guest)
on 2008-11-22 15:26
(Received via mailing list)
John Moore wrote:
>
>
Well, as ever the problem was simpler than I thought, and I was looking
in the wrong place. I had an extra closing parenthesis on the end.
Removing that sorted my problem.
This topic is locked and can not be replied to.