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

Details

Reference
bz73510

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 3:48 AM
bzimport added a project: MediaWiki-Vagrant.
bzimport set Reference to bz73510.
bzimport added a subscriber: Unknown Object (MLST).
Seb35 created this task.Nov 17 2014, 10:00 AM

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 Normal to Low.
bd808 set Security to None.
Gilles raised the priority of this task from Low to Normal.Jun 22 2015, 6:40 PM
Gilles added a subscriber: Gilles.

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

Gilles claimed this task.Jun 22 2015, 6:44 PM

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

Gilles closed this task as Resolved.Jun 24 2015, 3:15 PM

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

Tgr added a subscriber: Tgr.Aug 30 2015, 8:26 AM

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

bd808 moved this task from Backlog to Done on the MediaWiki-Vagrant board.Dec 7 2015, 12:52 AM