Lukas Renggli wrote:
Actually, one
would think that the solution above would work, but
in my
case it does not. In fact, sometimes I get the path repeated 3 times!
That's strange this never occurred to me.
It would help to find this problem if I understood more of what Seaside
is suppose to do when there is a page time-out. Can anyone explain the
logic at page-time out for seaside?
=======================
For those interested (I suppose it's only me), Here are traces from the
rewrite log with different rewrite rules.
Modules loaded:
rewrite_module
proxy_module
proxy_http_module
No cache modules loaded
*No* other "proxy" directives used except below
*===TRACE 1=====
*ProxyPreserveHost On
RewriteEngine ON
RewriteRule ^/seaside/files/(.*)$
http://localhost:9999/seaside/files/$1
[proxy,last]
RewriteCond /home/web/mmiki/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$
http://localhost:9999/seaside/mmiki/$1 [proxy,last]
Result: at page timeout, it appears that seaside writes the path to the
Pier app, resulting in a duplicated path
[Start rewrite engine on request]
(2) init rewrite engine with requested uri /DonsTestPage
[is there a match with first rule?]
(3) applying pattern '^/seaside/files/(.*)$' to uri '/DonsTestPage'
[nope, check next rule]
(3) applying pattern '^/(.*)$' to uri '/DonsTestPage'
[yep, look at the condition before this]
(4) RewriteCond: input='/home/web/mmiki//DonsTestPage'
pattern='!-f' => matched
[nope, this isn't a local file, so rewrite it]
(2) rewrite /DonsTestPage ->
http://localhost:9999/seaside/mmiki/DonsTestPage
[and send it to seaside with the proper path]
(2) forcing proxy-throughput with
http://localhost:9999/seaside/mmiki/DonsTestPage
(1) go-ahead with proxy request
proxy:http://localhost:9999/seaside/mmiki/DonsTestPage [OK]
[but, then it continues - THIS MUST BE THE TIME OUT]
[Start rewrite engine on request]
(2) init rewrite engine with requested uri
/seaside/mmiki/DonsTestPage
[is there a match with first rule?]
(3) applying pattern '^/seaside/files/(.*)$' to uri
'/seaside/mmiki/DonsTestPage'
[nope, check next rule]
(3) applying pattern '^/(.*)$' to uri '/seaside/mmiki/DonsTestPage'
[yep, look at the condition before this]
(4) RewriteCond: input='/home/web/mmiki//seaside/mmiki/DonsTestPage'
pattern='!-f' => matched
[nope, this isn't a file, so rewrite it]
(2) rewrite /seaside/mmiki/DonsTestPage ->
http://localhost:9999/seaside/mmiki/seaside/mmiki/DonsTestPage
[and send it on it's way]
(2) forcing proxy-throughput with
http://localhost:9999/seaside/mmiki/seaside/mmiki/DonsTestPage
(1) go-ahead with proxy request
proxy:http://localhost:9999/seaside/mmiki/seaside/mmiki/DonsTestPage [OK]
*===TRACE 2=============*
If a rewrite rule is added to eliminate the path at the time out:
================
ProxyPreserveHost On
RewriteEngine ON
RewriteRule ^/seaside/files/(.*)$
http://localhost:9999/seaside/files/$1
[proxy,last]
RewriteRule ^/seaside/mmiki/(.*)$
http://localhost:9999/$1 [proxy,last]
RewriteCond /home/web/mmiki/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$
http://localhost:9999/seaside/mmiki/$1 [proxy,last]
Result: 2nd rewrite rule catches path but seaside really needs the path
to the Pier app.
(2) init rewrite engine with requested uri /DonsTestPage
(3) applying pattern '^/seaside/files/(.*)$' to uri '/DonsTestPage'
(3) applying pattern '^/seaside/mmiki/(.*)$' to uri '/DonsTestPage'
(3) applying pattern '^/(.*)$' to uri '/DonsTestPage'
(4) RewriteCond: input='/home/web/mmiki//DonsTestPage' pattern='!-f' =>
matched
(2) rewrite /DonsTestPage ->
http://localhost:9999/seaside/mmiki/DonsTestPage
(2) forcing proxy-throughput with
http://localhost:9999/seaside/mmiki/DonsTestPage
(1) go-ahead with proxy request
proxy:http://localhost:9999/seaside/mmiki/DonsTestPage [OK]
(2) init rewrite engine with requested uri /seaside/mmiki/DonsTestPage
(3) applying pattern '^/seaside/files/(.*)$' to uri
'/seaside/mmiki/DonsTestPage'
(3) applying pattern '^/seaside/mmiki/(.*)$' to uri
'/seaside/mmiki/DonsTestPage'
(2) rewrite /seaside/mmiki/DonsTestPage ->
http://localhost:9999/DonsTestPage
(2) forcing proxy-throughput with
http://localhost:9999/DonsTestPage
(1) go-ahead with proxy request proxy:http://localhost:9999/DonsTestPage
[OK]
*===TRACE 3===========*
But,of course seaside needs the path to the app.
If the rewrite rule is written to add the path for the timeout
It works fine. Except the URL in the browser adds the path
===============
ProxyPreserveHost On
RewriteEngine ON
RewriteRule ^/seaside/files/(.*)$
http://localhost:9999/seaside/files/$1
[proxy,last]
RewriteRule ^/seaside/mmiki/(.*)$
http://localhost:9999/seaside/mmiki/$1
[proxy,last]
RewriteCond /home/web/mmiki/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$
http://localhost:9999/seaside/mmiki/$1 [proxy,last]
Result: 2nd RewriteRule adds the correct path, but the URL the client
receives includes the path. Not pretty.
(2) init rewrite engine with requested uri /DonsTestPage
(3) applying pattern '^/seaside/files/(.*)$' to uri '/DonsTestPage'
(3) applying pattern '^/seaside/mmiki/(.*)$' to uri '/DonsTestPage'
(3) applying pattern '^/(.*)$' to uri '/DonsTestPage'
(4) RewriteCond: input='/home/web/mmiki//DonsTestPage' pattern='!-f' =>
matched
(2) rewrite /DonsTestPage ->
http://localhost:9999/seaside/mmiki/DonsTestPage
(2) forcing proxy-throughput with
http://localhost:9999/seaside/mmiki/DonsTestPage
(1) go-ahead with proxy request
proxy:http://localhost:9999/seaside/mmiki/DonsTestPage [OK]
(2) init rewrite engine with requested uri /seaside/mmiki/DonsTestPage
(3) applying pattern '^/seaside/files/(.*)$' to uri
'/seaside/mmiki/DonsTestPage'
(3) applying pattern '^/seaside/mmiki/(.*)$' to uri
'/seaside/mmiki/DonsTestPage'
(2) rewrite /seaside/mmiki/DonsTestPage ->
http://localhost:9999/seaside/mmiki/DonsTestPage
(2) forcing proxy-throughput with
http://localhost:9999/seaside/mmiki/DonsTestPage
(1) go-ahead with proxy request
proxy:http://localhost:9999/seaside/mmiki/DonsTestPage [OK]
This is the desired path, but the URL in the client browser is incorrect:
It is:
http://igor:8080/seaside/mmiki/DonsTestPage?command=PRViewCommand&view=…
It should not have the "/seaside/mmiki" path, And, actually, this
doesn't work when you want to go back to the top in Pier after timeout.