[bitnami/mediawiki] improve configuration for reverse proxy configs
several changes to improve behavior when running behind a reverse proxy:
- we need the
RewriteRulein the vhost to match$wgArticlePathin the applicationLocalSettings.php, which requires that it be modified at startup in order to respect custom values ofMEDIAWIKI_WIKI_PREFIX. - setting
$wgScriptPathto""is fine for the normal case, but if you're running behind a reverse proxy and want to serve MediaWiki on one path (e.g.,/wiki) and other services on other paths, being able to set the script path as non-root makes proxy routing easier. - setting
$wgServertoMEDIAWIKI_HOSTresults in absolute URLs including the full hostname and port, instead of relative URLs, which breaks links when the reverse proxy is running on a different port. for the same reason, set$wgAssumeProxiesUseDefaultProtocolPortsto false.
Fixes https://github.com/bitnami/containers/issues/64097
added a few commits, i was going to make separate PRs but these changes depend on each other. i'll update the PR description.
anything i can do to help move this forward?
@migruiz4 thanks for the review! I added a commit setting MEDIAWIKI_SCRIPT_PATH to / by default, restoring the existing behavior.
Hi @dunn,
Thank you for your contribution. However, these changes are breaking the functionality of the container, you get several redirect loops when you try to access the app or work with it. This is preventing our test to pass and update the Chart solution.
We are planing some changes to make the solution work again and they will be included in the next release:
- Recover the old logic to configure the $wgServer parameter in the conf file
- The $wgCanonicalServer parameter uses that configuration by default according to the official documentation: https://www.mediawiki.org/wiki/Manual:$wgCanonicalServer
- RewriteRules will be updated to use the ones mentioned in the official documentation https://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_Title_--_.htaccess
If you continue running into issues when running the app behind a proxy, please do create another PR to update the configuration taking these changes into account.
Changes were applied here: https://github.com/bitnami/containers/pull/67621