Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod_proxy_ajp & static content

Status
Not open for further replies.

dfelicia

Technical User
Aug 2, 2006
2
US
Is it possible to configure mod_proxy_ajp so it only passes dynamic content (e.g. *.jsp) to the servlet engine?

With mod_jk, this is easily accomplished:

JkMount /*.jsp ajp13

The desired result is to serve static stuff via Apache using an Alias/Directory directive, and serve *.jsp via AJP.

Oh, and the URL has to be the same.
 
I've not used [tt]mod_proxy_ajp[/tt] before but accomplished similar using [tt]mod_proxy[/tt] without any noticable problems.

Here are a few examples. You should only need one [tt]ProxyPass[/tt] statement. I use this in a [tt]<VirtualHost>[/tt] statement and with SSL certs but it should work anywhere. Edit accordingly.

Code:
<IfModule mod_proxy.c>
    ProxyRequests On
    ProxyPass /servlet/*.jsp [URL unfurl="true"]https://your.host:8080/servlet/webacc[/URL]
    ProxyPass /*.jsp [URL unfurl="true"]https://your.host:8080/servlet/webacc[/URL]
</IfModule>

Hope you find it useful.

Have fun! [afro2]
 
Got it working. Here's how I did it:

<Directory "/foo/bar">
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /bar "/foo/bar"

RewriteEngine On
RewriteRule ^/bar/(.*)\.jsp$ ajp://127.0.0.1:45002/bar/$1.jsp [P]
RewriteRule ^/bar/(.*)\.jsv$ ajp://127.0.0.1:45002/bar/$1.jsv [P]
RewriteRule ^/bar/(.*)\.jsw$ ajp://127.0.0.1:45002/bar/$1.jsw [P]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top