Page MenuHomePhabricator

Role https does not properly set $wgServer
Closed, ResolvedPublic

Description

Symptom: With a fresh MediaWiki-Vagrant with the https role, the resources (JS+CSS) are not loaded over HTTPS because the $wgServer variable is set to WebRequest::detectServer() in /vagrant/settings.d/wiki/CommonSettings.php (see bug 66399).

Explaination: The HTTPS is performed using nginx as a reverse proxy, and the function WebRequest::detectServer() assume in this case the HTTPS port is standard (443) instead of 4430 in MediaWiki-Vagrant ($wgServer = 'https://127.0.0.1').


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=70964

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:48 AM
bzimport set Reference to bz73510.
bzimport added a subscriber: Unknown Object (MLST).

It could be used the config variable $wgHttpsPort introduced in bug 65184: in WebRequest::detectServer(), in the case of HTTPS behind a reverse proxy, use $wgHttpsPort (default is obviously 443).

This solution should be double-checked since it would impact Wikimedia servers.

bd808 renamed this task from HTTPS port is incorrect to Role https does not properly set $wgServer.Dec 30 2014, 5:31 PM
bd808 lowered the priority of this task from Medium to Low.
bd808 set Security to None.
Gilles raised the priority of this task from Low to Medium.Jun 22 2015, 6:40 PM
Gilles subscribed.

Given that we're now all https and all, it seems like our https role should work!

Change 219901 had a related patch set uploaded (by Gilles):
Make proxy behaviour of detectServer() configurable

https://gerrit.wikimedia.org/r/219901

Change 219901 merged by jenkins-bot:
Make proxy behaviour of detectServer() configurable

https://gerrit.wikimedia.org/r/219901

Change 220074 had a related patch set uploaded (by Gilles):
HTTPS role should set wgAssumeProxiesUseDefaultProtocolPorts to false

https://gerrit.wikimedia.org/r/220074

Change 220074 merged by jenkins-bot:
HTTPS role should set wgAssumeProxiesUseDefaultProtocolPorts to false

https://gerrit.wikimedia.org/r/220074

A stock vagrant VM should now have its https role work out of the box.

It only seems to work through the host machine port forward though, not when one vagrant box is connecting to the other.