mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #400] Configuring Nginx Proxy Manager with wordpress?? #342
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#342
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wagners1 on GitHub (May 9, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/400
Hi,
Has anyone had any success configuring NPM with wordpress. I have been trying to figure it our for agers with no success. The website can be accessed normally but when I point NPM to the ip address and port it will not work. I just get a connection timeout. I get the domain and the port.
I have about 10 services that NPM work flawlessly with but I just cant get wordpress to work. Can someone assist please?
Thanks in advance.
Simon
@wagners1 commented on GitHub (May 9, 2020):
I finally figured it out.... thx to below link. Minor edit below.
https://ahenriksson.com/2020/01/27/how-to-set-up-wordpress-behind-a-reverse-proxy-when-using-nginx/
In order to fix this you first have to add this at the very start of your wp-config.php. This file is the wordpress config file.
define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
Then in the end of the file add the following, replacing “website.com” with your own URL.
define('WP_HOME','https://website.com');
define('WP_SITEURL','https://website.com');
The website should now work correctly.
for me
proxy_set_header X-Forwarded-Proto https;
was not required in NPM
@theraw commented on GitHub (May 10, 2020):
if you install ssl on your wordpress on nginx proxy manager use port
443not80if your wordpress has no ssl then use port 80, i don't see a reason why it should fail.is same as cloudflare proxy. if cloudflare had failed like that ppl would've had bigger problems.
@styxadmin commented on GitHub (May 12, 2020):
I've got the same problem. Deployed Wordpress using OpenLiteSpeed
The Wordpress Admin page works flawlessly but the main site is not loading all its content.
I tried your fix @wagners1 but it didnt work for me
@theraw commented on GitHub (May 12, 2020):
@Abs0lutZero that is just your template problems or browser cache has nothing to do with this project




tested with multiple themes
@styxadmin commented on GitHub (May 13, 2020):
Thanks @theraw
I did a clean install of my OLS + WP deployment and set up the proxy as http on port 80 and now everything works.
@huangwb8 commented on GitHub (Apr 10, 2022):
@wagners1 Your setting is not work for me. I still get ERR_TOO_MANY_REDIRECTS.
Would you please share your NPM settings?
@ghost commented on GitHub (Jun 2, 2022):
A few days ago, I had the same problem as you. This one didn't come from npm, but from the apache config.
I share you my settings if it can help you:
My vhost:
__________________________________________
<VirtualHost *:80>
ServerAdmin webmaster@mydomain.com
ServerName mydomain.com
ServerAlias mydomain.com.dev
DocumentRoot /mnt/nfs/vhost/mydomain.com
<Directory /mnt/nfs/vhost/mydomain.com/>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
<Directory /mnt/nfs/vhost/mydomain.com/wp-content>
Options FollowSymLinks
Require all granted
ErrorLog /mnt/nfs/vhost/system/mydomain.com/logs/error.log
__________________________________________
Line added to my wp-config.php:
__________________________________________
define( 'WP_HOME', 'http://mydomain.com' );
define( 'WP_SITEURL', 'http://mydomain.com' );
__________________________________________
My host in NPM
__________________________________________
Source: mydomain.com
Destination: http://IPADRESS:80
SSL: Custom
Details:

SSL:

__________________________________________
For me, this config work. I hope it will help you.
@daominhsangvn commented on GitHub (Dec 15, 2022):
For the people who tried all above method not working, try this (its working for me, none of above did)
Add the following config to your nginx config file
@theraw commented on GitHub (Dec 15, 2022):
@daominhsangvn remember that if you change something from panel these custom changes manually done to nginx configs could be lost.
@RapidFire05 commented on GitHub (Feb 22, 2023):
I was able to fix using these docs: https://wordpress.org/documentation/article/administration-over-ssl/#using-a-reverse-proxy
I had the 'Too Many Redirects Error'. Do not believe this is an error with NPM. Just needed to edit the wp-config.php file.
@huangwb8 commented on GitHub (Feb 22, 2023):
@RapidFire05 Yes, NPM is OK. My solution is using Full mode of SSL/TLS in Cloudflare, the DNS provider of my domain:

Sorry for the delay reply. I just forget the problem I ask (ฅ´ω`ฅ)
@coderofsalvation commented on GitHub (Mar 22, 2023):
Ok, just for completeness, one of the main culprits is
$request_uri(which is passed by default, because ofinclude /data/nginx/custom/server_proxy[.]conf;).$request_urialways represents the original url (not affected by nginx rewrites/redirects etc).This is sane & secure proxy-behaviour, but for a simple wordpress-docker, you can just add rewrites by copy/pasting this into the advanced-tab (but excluding
$request_uri)@s-wighton commented on GitHub (Apr 5, 2023):
I've been following this issue as I've had my own problems with the site health complaining of:
This may help others troubleshooting WP / NPM config issues.
Additional step that resolved the errors for me was adding the NPM server IP and website domain name on the WordPress web server /etc/hosts
For completeness my configs are:
/var/www/website.com/wp-config.php
/etc/apache2/sites-enabled/website.com.conf
Same NPM set up as above, however I removed all the Custom Nginx Configuration, and it's still working. 🙏
@robtry commented on GitHub (Jun 23, 2023):
I wrote a tutorial with the config that worked for me
https://robgg.hashnode.dev/wordpress-docker-nginx-proxy-manager-cloudfare