Welcome! Log In Create A New Profile

Advanced

Re: How to set a option within a location block

--[ UxBoD ]--
July 07, 2010 08:30AM
----- Original Message -----
> On Wed, Jul 07, 2010 at 12:29:58PM +0100, --[ UxBoD ]-- wrote:
>
> > ----- Original Message -----
> > > On Wed, Jul 07, 2010 at 12:22:02PM +0100, --[ UxBoD ]-- wrote:
> > >
> > > > ----- Original Message -----
> > > > > On Wed, Jul 07, 2010 at 11:12:42AM +0100, --[ UxBoD ]-- wrote:
> > > > >
> > > > > > ----- Original Message -----
> > > > > > > On Wed, Jul 07, 2010 at 10:06:16AM +0100, --[ UxBoD ]--
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I have the URL http://www.xyz.com/dav/xxx and I need to
> > > > > > > > be
> > > > > > > > able
> > > > > > > > to
> > > > > > > > set http_timeout only when /dav/ is present in the URL.
> > > > > > > > The
> > > > > > > > problem
> > > > > > > > is that the configuration is third party supplied and
> > > > > > > > they
> > > > > > > > already
> > > > > > > > have:
> > > > > > > >
> > > > > > > > location /
> > > > > > > > {
> > > > > > > >
> > > > > > > > }
> > > > > > > >
> > > > > > > > So is it possible to have a location within a location
> > > > > > > > for
> > > > > > > > something
> > > > > > > > like:
> > > > > > > >
> > > > > > > > location /
> > > > > > > > {
> > > > > > > > location ^~ /dav/ {
> > > > > > > > keepalive_timeout 0;
> > > > > > > > }
> > > > > > > > }
> > > > > > >
> > > > > > > It's possible, but why can not you add
> > > > > > >
> > > > > > > location /dav/ {
> > > > > > > }
> > > > > > >
> > > > > > > before or after
> > > > > > >
> > > > > > > location / {
> > > > > > > }
> > > > > > >
> > > > > > > ?
> > > > > >
> > > > > > Would need to duplicate all the other options within the
> > > > > > /dav/
> > > > > > block
> > > > > > as once it matches it does not process the other location
> > > > > > block.
> > > > >
> > > > > You may move common directives outside "location /":
> > > > >
> > > > > common all directives
> > > > >
> > > > > location / {
> > > > > }
> > > > >
> > > > > location /dav/ {
> > > > > }
> > > > >
> > > >
> > > > Igor, to be clear on the flow then that would process all the
> > > > directives under '/' and then if the URI contains /dav/ it would
> > > > also pull in what ever is in that location block; in essence
> > > > inherit
> > > > all the directives ?
> > >
> > > No, please read this:
> > > http://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration
> > >
> > >
> >
> > Ah okay :) Thank you Igor that answers the question; will have to
> > duplicate directives within the /dav/ like the / literal but also
> > include the timeout. Is there any other way to include a specific
> > directive without duplication ?
>
> You may move them on upper level: server or http.
> Or you may move them to a file and include the file.
>
> However, I prefer to put all directives explicitly, this allows to
> create
> scaleable configurations.
>
>

Hi Igor, appreciate all the help you have provided. I think we shall need to leave it within the server section; which is a pity as it will apply to every URI eg:

http://www.xyz.com/contacts
http://www.xyz.com/dav

where it would have been great for it to only apply to /dav; but the literal location contains lots and lots of directives and I would hate to duplicate them all into a separate location block.
--
Thanks, Phil

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to set a option within a location block

--[ UxBoD ]-- July 07, 2010 05:12AM

Re: How to set a option within a location block

--[ UxBoD ]-- July 07, 2010 05:22AM

Re: How to set a option within a location block

Boris Dolgov July 07, 2010 05:28AM

Re: How to set a option within a location block

Boris Dolgov July 07, 2010 05:24AM

Re: How to set a option within a location block

Igor Sysoev July 07, 2010 05:44AM

Re: How to set a option within a location block

--[ UxBoD ]-- July 07, 2010 06:16AM

Re: How to set a option within a location block

Igor Sysoev July 07, 2010 06:26AM

Re: How to set a option within a location block

--[ UxBoD ]-- July 07, 2010 06:20AM

Re: How to set a option within a location block

--[ UxBoD ]-- July 07, 2010 07:28AM

Re: How to set a option within a location block

Igor Sysoev July 07, 2010 07:32AM

Re: How to set a option within a location block

--[ UxBoD ]-- July 07, 2010 07:34AM

Re: How to set a option within a location block

Igor Sysoev July 07, 2010 07:38AM

Re: How to set a option within a location block

edogawaconan July 07, 2010 08:28AM

Re: How to set a option within a location block

--[ UxBoD ]-- July 07, 2010 08:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready