Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
_regex proxy preconnect remap
lawspetvetri
Hi,
I have encountered a strange behaviour of proxy preconnect remap
Below are the lines that I have in iw.cfg
_regex=(.*/SolarisFarm/content)/.*/(WORKAREA/[^/]*|STAGING|EDITION/[^/]*)//?(images/.*)=$1/homepage/WORKAREA/development/$3
_regex=(.*/SolarisFarm/content)/.*/(WORKAREA/[^/]*|STAGING|EDITION/[^/]*)//?(css/.*)=$1/homepage/WORKAREA/development/$3
_regex=(.*/SolarisFarm/content)/.*/(WORKAREA/[^/]*|STAGING|EDITION/[^/]*)//?(js/.*)=$1/homepage/WORKAREA/development/$3
The js references in the shtml file gets properly remapped while the images are broken. (The images are getting redirected even when the reference is something like <img src="/test/images/test.gif">. Actually, it should get redirected only when it is <img src="/images/test.gif"> according to the regex)
On investigation, when I commented the regex line for js, the images begin to show up. (I started referring js directly from the production web server)
Any lead in this regard would be of great help.
FYI, the environment is TS 5.5.2 SP 4 on Solaris 8 and the webserver is iPlanet 6.
Thanks,
Vetri
Find more posts tagged with
Comments
iwovGraduate
Thats probably because your regex matches "images" not "/images"
Try using
_regex=(.*/SolarisFarm/content)/.*/(WORKAREA/[^/]*|STAGING|EDITION/[^/]*)//?(
/
images/.*)=$1/homepage/WORKAREA/development/$3
shanon
can you just explain generically what you're trying to do? ie. which branches / paths you'd like to map as well as some examples? i think you may have some extra information in there...
Shanon Levenherz
Mercer eBusiness Team
shanon.levenherz@mercer.com
http://www.mercerhr.com
lawspetvetri
There is a common navbar and some global images that are referred in all the sites and we are maintaining them in a common branch. So, whenever there is reference like /images or /js, we direct those request to the images and js folder in the common branch.
The site-specific images are maintained in a different hirearchy. The directory structure will be like <workarea>/<sitename>/images/. So, references to these site-specific images will be like /<sitename>/images/<imagename> (rathern than just /images)
For example, if the site name is 'training', the directory structure will be <workarea>/training/images/ and the images that are specific to the site will be referred as /training/images/ (eg. /training/images/trnglogo.gif). The global image, say companylogo.gif will be referred as /images/companylogo.gif, which in turn will be re-directed to /homepage/images/companylogo.gif
Hope my explanation is fair enough.
Adam Stoller
Have you run iwproxy in debug mode?
You'll probably have to do that and post the infromation (as an attachment) in order for anyone to assist here.
What you've shown so far - **looks** reasonable (you seem to be expecting either a single or double-slash after the areavpath) -- though I might suggest that the redirection should probably go to STAGING rather than WORKAREA/development ...
Without seeing the [annotated?] results of a debugging session it would be difficult to figure out what's going wrong. Is it possible there's some other mapping that is taking place before hand that changes the URI before the regex's you posted come into play?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
nipper
I agree with fish, on Solaris it is easy.
ps _ef | grep iwproxy
find iwproxy & kill it (as root)
run iwproxy -d > /tmp/out.txt
(you may need to trap STDERR as well as STDOUT, but I do not think so).
run your test , kill the proxy & restart it without debug.
Peruse the file, & post if it you need.
Check the manual, my the steps are mostly (if not completely correct)
Andy
shanon
w/out seeing the iwproxy debug, here's the regexp i would try:
(.*SolarisFarm/content/).*/(WORKAREA/[^/]*|STAGING|EDITION/[^/]*)(/images/.*)=$1/homepage/STAGING$3
( swap out images w/ js and css for the others )
this one ensures that "/images" is right after the workarea name, so it will not match /training/images/foo.jpg... i think it was just the slash issue ... what were you trying to do w/ the //? right before images?
also, i agree w/ fish that you should use the staging area ...
Shanon Levenherz
Mercer eBusiness Team
shanon.levenherz@mercer.com
http://www.mercerhr.com
Adam Stoller
My guess on the //? is that they weren't sure if some of the paths were being generated with a double-slash by accident - and wanted to be able to handle "/images" and "//images" identically - so the idea was to expect at least one '/' followed by an optional second '/'
Maybe: /(/|)(images/.*)
might work better?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
lawspetvetri
Thanks for all your responses.
Please refer the attached iwproxy.out log file when the index page is previewed.
From my understanding, it gets redirected for the js to the 'homepage' branch and then after, whenever there is a request for '/marketplace/images/Marketplace.gif', it is prefixed with the workarea in homepage branch, whereas it should be prefixed with the workarea in 'marketplace' branch. (Refer 'Request from client' for /marketplace/images/Marketplace.gif in particular)
That's the reason, I said in my original post, when I comment the line for js, the images show up (This is because, it does not refer to 'homepage' branch at all)
Thanks,
Vetri