aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-10-05 23:06:48 +0100
committerSimon McVittie <smcv@debian.org>2014-10-05 23:49:37 +0100
commit3b8da667cc1514a9589190b614307c0a76af532a (patch)
tree48d4d35e0c6cd9f68f0e2cace61f1ad79e8473ea /IkiWiki
parentd712389ae3e8351c1416aa81d4b85586cf98f002 (diff)
downloadikiwiki-3b8da667cc1514a9589190b614307c0a76af532a.tar
ikiwiki-3b8da667cc1514a9589190b614307c0a76af532a.tar.gz
Add reverse_proxy option which hard-codes cgiurl in CGI output
This solves several people's issues with the CGI trying to be too clever when IkiWiki is placed behind a reverse-proxy.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/CGI.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index b6f47a3a7..70e3b7134 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -59,7 +59,7 @@ sub cgitemplate ($$$;@) {
my $template=template("page.tmpl");
my $topurl = $config{url};
- if (defined $cgi && ! $config{w3mmode}) {
+ if (defined $cgi && ! $config{w3mmode} && ! $config{reverse_proxy}) {
$topurl = $cgi->url;
}
@@ -93,7 +93,13 @@ sub cgitemplate ($$$;@) {
sub redirect ($$) {
my $q=shift;
eval q{use URI};
- my $url=URI->new(urlabs(shift, $q->url));
+
+ my $topurl;
+ if (defined $q && ! $config{w3mmode} && ! $config{reverse_proxy}) {
+ $topurl = $q->url;
+ }
+
+ my $url=URI->new(urlabs(shift, $topurl));
if (! $config{w3mmode}) {
print $q->redirect($url);
}