Context with "exp: ..." URI don't seem to work

Discussion in 'Bug Reports' started by Roman2K, Oct 23, 2005.

  1. Roman2K

    Roman2K New Member

    Hello,

    I have a FastCGI application running on URI / of a virtualhost. I would like web requests of files (which are named like *.*) not to be routed to this FastCGI application so I have set two contexts for this virtual host in the following sequence order :

    1) Static :
    URI = exp:(.+\.[^\/]+)$
    Location = $DOC_ROOT/$1
    Accessible = Yes

    2) FastCGI : a working context with URI = /

    I reloaded and even restarted LSWS with no success : every time I try to access a file on this virtual host (for example : /css/style.css which exists and is accessible without the context of sequence 2) the request is routed to the FastCGI app.

    When I set URI ="/css/" with location = $DOC_ROOT/css/ in the URI of the context #1, I can view my /css/style.css => is "exp:..." in URIs not working ?
    What is wrong ? How to achieve my goal ?

    Thank you for answers.
  2. mistwang

    mistwang LiteSpeed Staff

    That's normal, as LSWS now only process matching context when there is no explicit direct match. So, in your case, the matching context has no effect. Normal contexts have high priority than matching contexts.

    With current release, you have to use normal contexts for those files like /css/ you tried.

    There is another possible work around by avoiding using FastCGI Context '/' which will match any request, instead, define a Matching FastCGI context with URI "exp:^/$" to match only request to '/' and other FastCGI contexts for each unique URI that should be processed by the FCGI.
    But, there is a bug with FastCGI Matching Context in current release that will be fixed. So you have to wait till next release to be able to do that.
  3. Roman2K

    Roman2K New Member

    Thank you for the answer mistwang.

    In the next version, can you make an an option to let normal contexts have the same priority as matching contexts on a per-vhost basis, or something like that, please ?

    I will wait for the next version anyway.

    Thanks,
    Roman.
  4. mistwang

    mistwang LiteSpeed Staff

    Yes, we will make the matching context higher priority if its sequence number is smaller than any normal context in next release.
  5. Roman2K

    Roman2K New Member

    Thanks mistwang.
  6. mistwang

    mistwang LiteSpeed Staff

  7. Roman2K

    Roman2K New Member

    Hello mistwang. It works with 2.1.5 ! Thank you again :D.

    There is a small bug now : I tried a context Static exp:^/((images|javascript)\/.+)$
    Although it appears correctly in my contexts list, when I try to view or edit it, all the rows of the table or the forum are empty.

    However, a FastCGI context with URI / is viewable and editable.

    Also, when I try to delete this context, I click "yes" to confirm and I am then redirected to an empty contexts list. When I click the "Context" tab I see the list back.

    Here is the generated context part of the vhost conf :
    Code:
    <contextList>
        <context>
          <type>NULL</type>
          <uri>exp:^/((images|javascript)\/.+)$</uri>
          <location>$DOC_ROOT/$1</location>
          <allowBrowse>1</allowBrowse>
          <accessControl>
          </accessControl>
          <addDefaultCharset>off</addDefaultCharset>
          <rewrite>
          </rewrite>
        </context>
        <context>
          <type>fcgi</type>
          <uri>/</uri>
          <handler>Test fcgi</handler>
          <accessControl>
          </accessControl>
          <addDefaultCharset>off</addDefaultCharset>
        </context>
    </contextList>
  8. mistwang

    mistwang LiteSpeed Staff

    Thank you for the update.
    The new bug should be fixed in the final 2.1.5 package.
    For that kind of context, it is better to use two plain context instead of one matching context, should be more efficient. :)

Share This Page