Discussion:
Absolute URL and Reverse Proxy
Martin Moebius
2014-05-19 07:56:36 UTC
Permalink
Hello,

I am trying to use a Dokuwiki with fckg behind an Apache reverse proxy and
found that fckg inserts one absolute link in the HTML-Pages. Example:

https://server.com:444/lib/plugins/fckg/scripts/script-cmpr.js


I tried to use mod_proxy_html to rewrite that, but ended up in a situation
where fck would no longer work correctly with Firefox.

So now I looked into the fckg code and found two places where the file is
linked:

"actions/meta.php"
$url = DOKU_URL . 'lib/plugins/fckg/scripts/script-cmpr.js';

"actions/edit.php"
$url = DOKU_URL . 'lib/plugins/fckg/scripts/script-cmpr.js';

I changed both lines, to use DOKU_BASE instead of DOKU_URL and my issue is
gone.

So my question is basicly does this link have to use DOKU_URL for any
reason or can you change it to DOKU_BASE?



Kind regards

Martin Möbius
Myron Turner
2014-05-19 12:55:15 UTC
Permalink
Post by Martin Moebius
Hello,
I am trying to use a Dokuwiki with fckg behind an Apache reverse proxy and
https://server.com:444/lib/plugins/fckg/scripts/script-cmpr.js
I tried to use mod_proxy_html to rewrite that, but ended up in a situation
where fck would no longer work correctly with Firefox.
So now I looked into the fckg code and found two places where the file is
"actions/meta.php"
$url = DOKU_URL . 'lib/plugins/fckg/scripts/script-cmpr.js';
"actions/edit.php"
$url = DOKU_URL . 'lib/plugins/fckg/scripts/script-cmpr.js';
I changed both lines, to use DOKU_BASE instead of DOKU_URL and my issue is
gone.
So my question is basicly does this link have to use DOKU_URL for any
reason or can you change it to DOKU_BASE?
I've made the change. fckg uses DOKU_BASE in all other instances.
Just as a matter of interest, the file scripts/script-cmpr.js is a
fail-safe, just in case Dokuwiki's script compressor fails to load
fckg/script.js on time.

Thanks,

Myron
--
Myron Turner
http://mturner.org/
http://mturner.org/fckgLite
https://github.com/turnermm
Martin Moebius
2014-05-19 13:09:44 UTC
Permalink
Post by Myron Turner
I've made the change. fckg uses DOKU_BASE in all other instances.
Just as a matter of interest, the file scripts/script-cmpr.js is a
fail-safe, just in case Dokuwiki's script compressor fails to load
fckg/script.js on time.
Thanks,
Myron
Thank you very much. I couldn't figure out what the problem with
mod_proxy_html was, I guess it messed up some Javascript-Code for Firefox.

Best Regards,
Martin

Loading...