Using Nginx Proxy Manager Plus (NPM+) makes managing this setup quite simple because its web UI automatically injects the primary X-Forwarded-For and X-Forwarded-Proto headers required for proper proxying. [1]
However, because InfiniteWP relies on heavy, uninterrupted API communication with your client sites, you will need to add custom timeout adjustments and tweak your backend files to avoid 504 Gateway Timeout or Too Many Redirects errors. [1]
1. Nginx Proxy Manager Plus UI Configuration
When adding or editing your InfiniteWP dashboard’s Proxy Host inside the NPM+ dashboard, ensure the following configurations are set: [2]
-
Details Tab:
- Forward Scheme: Set this to
httporhttpsdepending on how your internal InfiniteWP backend is hosted. - Websockets Support: Enable this. While InfiniteWP relies heavily on standard HTTP REST requests, keeping this on helps with persistent admin panel connections.
- Block Common Exploits: Enable this for basic firewalling. [2]
- Forward Scheme: Set this to
-
SSL Tab:
- Select your SSL Certificate (e.g., via Let’s Encrypt).
- Force SSL: Enable this.
- HTTP/2 Support: Enable this to allow multiplexed connections, accelerating batch updates to multiple sites. [2, 3, 4]
2. Advanced Nginx Tweaks (Crucial for InfiniteWP)
InfiniteWP sends large bulk requests when updating plugins or running backups across dozens of sites simultaneously. Default Nginx timeout limits are usually too short, causing the proxy to drop the connection before the backend finishes processing.
Go to the Advanced tab of your Proxy Host in NPM+ and paste the following snippet into the Custom Nginx Configuration block:
# Prevent 504 Gateway Timeouts during long plugin updates or backups
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
send_timeout 300s;
# Allow larger payload transfers (like uploading a plugin/theme zip via dashboard)
client_max_body_size 128M;
# Optimise buffer allocations for large API payloads
proxy_buffers 8 16k;
proxy_buffer_size 32k;
3. The `wp-config.php` Update
To stop an infinite redirect loop (where NPM+ handles the SSL but InfiniteWP still thinks it’s on an unencrypted HTTP network), you must explicitly tell the app it is behind a proxy. [1]
Open the wp-config.php file on your InfiniteWP hosting server and insert this at the very top of the file (right after the opening <?php tag): [5]
// Force SSL and allow WordPress to recognize the NPM+ reverse proxy
define('FORCE_SSL_ADMIN', true);
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
Are you hosting the InfiniteWP admin panel on the same Docker network as Nginx Proxy Manager Plus, or is it running on a separate physical/virtual server? Let me know if you need help passing the real client IP addresses through to your application firewall.
- [1] https://blog.programster.org/using-wordpress-with-a-reverse-proxy-or-load-balancer
- [2] https://www.youtube.com/watch?v=kR01Is8Xa2M
- [3] https://nginxproxymanager.com/guide/
- [4] https://github.com/NginxProxyManager/nginx-proxy-manager/issues/400
- [5] https://www.reddit.com/r/selfhosted/comments/bi3utx/wordpress_behind_nginx_reverse_proxy/
