Page MenuHomePhabricator

Making MediaWiki reversed proxying able (use HTTP_HOST for redirects if set)
Closed, ResolvedPublic

Description

Mediawiki should use the HTTP_HOST instead of SERVER_NAME, if the first one is set.

Problem: Using a tcp-forward HTTP-redirect do not work because the server name
included in the Location header is set based on the local settings of the
webserver. However, the name of the reversed proxy should be used. This one is
provided in the HTTP-"Host:"-header, if HTTP 1.1 is used.


Version: unspecified
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz273

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 6:48 PM
bzimport set Reference to bz273.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 23
use HTTP_HOST if set

Attached:

You can already manually set $wgServer to anything you like.

Note that using HTTP_HOST indiscriminately may not be the best idea; a server not configured for strict name-based virtual hosts
will accept anything in that header, so the resulting URL could go to an arbitrary site. If it's not validated, it may even open up
various injection attacks. It's also bad for caching since the result may differ as various clients connect to the server with different
hostnames. $wgServer is supposed to be a consistent, canonical form.

Marking as a duplicate of bug 61, for detecting more sensible default values of $wgServer.

  • This bug has been marked as a duplicate of 61 ***
epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:19 AM