URL Matching Plugin
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Perlbal > URL Matching Plugin




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    URL Matching Plugin  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-01-06 06:12 AM

For what it's worth, I've written a very simple URL matching plugin
for perlbal at http://jeremy.publication.org.uk/Urlmatch.pm

It's based heavily on Vhosts, since it basically does the same thing
with slightly different criteria, with the intention of being able to
serve directories of static files much quicker than something like
Apache, but still pass through any requests to dynamic content.

A good modification would be to be able to re-write URLs to be
relative to a static root (at the moment, it passes through the whole
URL to the web_server part), but this is ok for us since docroot can be
the same as used by apache.

Imaginary crazy config would be something like (it's a psuedo-apache
matching syntax. * matches non-slashes. ** matches all)...

LOAD urlmatch

CREATE SERVICE static
SET role = web_server
SET docroot = /var/www/
ENABLE static

CREATE POOL apache
POOL apache ADD 127.0.0.1:8000
CREATE SERVICE redir
SET role = reverse_proxy
SET pool = apache
SET persist_backend = on
ENABLE redir

CREATE SERVICE urlmatch
SET listen = 0.0.0.0:80
SET role = selector
SET plugins = urlmatch
SET persist_client = on

URL /**/images/** = static
URL /styles/autostyles.css = redir
URL /styles/* = static

URL /** = redir  # This should match everything else
ENABLE urlmatch

...I'm just making this up, but typically you might just have a static
directory you want served directly, and everything else dynamic. Each
URL is checked in turn against those specified for the first available
match.

Comments, Suggestions, Fixes, Complete Re-Writes, Abject Criticism,
Inclusion into perlbal Source Tree etc. all welcome.

Jeremy






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:07 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register