Our customer support wiki runs on an internal host (ip:192.168.1.100:300, hostname a-node100.:300) and it is behind the nginx reverse proxy server. However, our Apache server end up displaying internal server name http://a-node100.:300/, which results into an unexpected redirection and timeouts as http://a-node100.:300/ is not accessible over the Internet. How do I force nginx or apache to use the base URL of our server (http://support.example.com/wiki/)?

No need to edit apache or nginx configuration. You need to setup $wgServer variable manually in LocalSettings.php to override the websever hostname setting. It should be set to the base URL of the server, including protocol and without the trailing slash. (eg, http://www.cyberciti.biz).

You need to use this to create fully-qualified URLs pointing to the wiki when you are behind the reverse proxy / caching server. Edit your $wiki/LocalSettings.php file, enter:
$ cd /var/www/html/wiki/
$ vi LocalSettings.php

You need to only setup base url (avoid using /wiki/ part in url):

$wgServer = 'http://support.example.com';

If you are using https (SSL based nginx) use https url:

$wgServer = 'https://support.example.com';

This is required for shared hosting, reverse proxy, or complex hosting solution. Save and close the file.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Said Dec 29, 2010 @ 16:03

    Hello,

    This blog has a problem with feeds. The last one was published on november 16!

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum