[GH-ISSUE #2590] Mediawiki behind NPM behaving inconsistently #1806

Closed
opened 2026-02-26 07:32:31 +03:00 by kerem · 2 comments
Owner

Originally created by @Encephala on GitHub (Feb 5, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2590

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

I'm trying to proxy a Mediawiki instance in rootless Podman through the official Mediawiki Docker image. I've imported an existing (non-Docker) Mediawiki instance into it. Nginx Proxy Manager is running as on the same machine, in the same network.

If I connect bypassing the proxy it works perfectly fine. However if access it through NPM, I get weird behaviour. I've configured Mediawiki through the $wgServer setting to generate proper redirect URLs in either scenario.

The page loads, but some parts of it won't. Which parts won't load is highly inconsistent; sometimes chrome leaves a blank grey page, sometimes the whole page loads but breaks as soon as I click a link, sometimes the side navbar doesn't load, etc. The Mediawiki instance just reports HTTP 200 codes, so it is not rejecting anything. Nginx on the other hand reports a ton of "[crit] connect() [...] failed (22: Invalid argument)", accompanied by a lot of "[warn] upstream server temporarily disabled while connecting to upstream" and "[error] upstream prematurely closed connection while reading upstream".

I'm running a wikijs instance in the exact same setup; rootless wiki container in the same network as NPM, which is proxying it. This works perfectly fine. I have no custom configuration in NPM and have ensured that the issue isn't to do with the firewalls; after running iptables -F it still happens.
I've tried proxying to the docker dns name and internal port, as well as publishing the Mediawiki's port to the host and proxying to the external hostname and port. The exact same issue occurs in both cases.

Nginx Proxy Manager Version

It says v2.9.19 (sidenote: it says this when pulling tag "v3" from Dockerhub).

To Reproduce
Steps to reproduce the behavior:

  1. Run the Mediawiki Docker container that publishes a specific port.
  2. Add a proxy host pointing to this container.
  3. Observe inconsistent page loading behaviour and errors reported by Nginx

Expected behavior

The mediawiki instance is proxied properly.

Screenshots

Error logs

Operating System

The host is running Ubuntu 22.04 on a cloud-rented VPS.

Additional context

Podman version 3.4.4
Mediawiki version 1.3.5

Originally created by @Encephala on GitHub (Feb 5, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2590 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** <!-- A clear and concise description of what the bug is. --> I'm trying to proxy a Mediawiki instance in rootless Podman through the official Mediawiki Docker image. I've imported an existing (non-Docker) Mediawiki instance into it. Nginx Proxy Manager is running as on the same machine, in the same network. If I connect bypassing the proxy it works perfectly fine. However if access it through NPM, I get weird behaviour. I've configured Mediawiki through the $wgServer setting to generate proper redirect URLs in either scenario. The page loads, but some parts of it won't. Which parts won't load is highly inconsistent; sometimes chrome leaves a blank grey page, sometimes the whole page loads but breaks as soon as I click a link, sometimes the side navbar doesn't load, etc. The Mediawiki instance just reports HTTP 200 codes, so it is not rejecting anything. Nginx on the other hand reports a ton of "[crit] connect() [...] failed (22: Invalid argument)", accompanied by a lot of "[warn] upstream server temporarily disabled while connecting to upstream" and "[error] upstream prematurely closed connection while reading upstream". I'm running a wikijs instance in the exact same setup; rootless wiki container in the same network as NPM, which is proxying it. This works perfectly fine. I have no custom configuration in NPM and have ensured that the issue isn't to do with the firewalls; after running iptables -F it still happens. I've tried proxying to the docker dns name and internal port, as well as publishing the Mediawiki's port to the host and proxying to the external hostname and port. The exact same issue occurs in both cases. **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> It says v2.9.19 (sidenote: it says this when pulling tag "v3" from Dockerhub). **To Reproduce** Steps to reproduce the behavior: 1. Run the Mediawiki Docker container that publishes a specific port. 2. Add a proxy host pointing to this container. 3. Observe inconsistent page loading behaviour and errors reported by Nginx **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> The mediawiki instance is proxied properly. **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> ![Error logs](https://user-images.githubusercontent.com/29434548/216833824-387034fb-8efa-4808-9be6-158c17c428d6.png) **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> The host is running Ubuntu 22.04 on a cloud-rented VPS. **Additional context** <!-- Add any other context about the problem here, docker version, browser version, logs if applicable to the problem. Too much info is better than too little. --> Podman version 3.4.4 Mediawiki version 1.3.5
kerem 2026-02-26 07:32:31 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Encephala commented on GitHub (Feb 19, 2023):

Not sure if the issue is with Nginx Proxy Manager. Closing issue for now.

<!-- gh-comment-id:1436026843 --> @Encephala commented on GitHub (Feb 19, 2023): Not sure if the issue is with Nginx Proxy Manager. Closing issue for now.
Author
Owner

@Encephala commented on GitHub (May 9, 2023):

For anyone who happens to stumble upon this later, the problem was with the Mediawiki container not working well with proxy_http_version 1.1;, which is set by default in Nginx Proxy Manager.

The solution is to manually set proxy_http_version 1.0; in the advanced config of your proxy host. Note that to do this, websockets must be disabled! Enabling websockets and having this in the advanced config leads to both proxy_http_version 1.0; and proxy_http_version 1.1; to be set in the config, which Nginx doesn't accept and thus the host will be down due to the bad config.

<!-- gh-comment-id:1539896096 --> @Encephala commented on GitHub (May 9, 2023): For anyone who happens to stumble upon this later, the problem was with the Mediawiki container not working well with `proxy_http_version 1.1;`, which is set by default in Nginx Proxy Manager. The solution is to manually set `proxy_http_version 1.0;` in the advanced config of your proxy host. Note that to do this, websockets must be disabled! Enabling websockets and having this in the advanced config leads to both `proxy_http_version 1.0;` and `proxy_http_version 1.1;` to be set in the config, which Nginx doesn't accept and thus the host will be down due to the bad config.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1806
No description provided.