Welcome! Log In Create A New Profile

Advanced

Nginx - Upstream for Backend Wordpress Blogs

Posted by dev0k 
Nginx - Upstream for Backend Wordpress Blogs
September 29, 2014 05:20AM
Hi Guys,

I have a little issue. I have 4 Servers ( behind a load balancer), but my Main Server was located at Germany. Now i will redirect all traffic via proxy to my main server. All works.

But when I try go to my own-plugin (and other uploaded external Plugins) so i got a Wordpress error: "You do not have sufficient permissions to access this page.". When i disable the load balancer and set a local route directly to the main server (1.2.3.4 my-domain.de) then all plugins work normaly.

upstream backend {
server 1.2.3.4:80; # main server
}

server {
listen 80;
server_name my-domain.de *.my-domain.de;
default_type text/html;
access_log off;

location ~ (wp-content|wp-includes|wp-admin|\.php) {
proxy_set_header Host $host;
proxy_pass_header Set-Cookie;
proxy_pass http://backend$request_uri$args;
}
}

Anyone can help me?
Re: Nginx - Upstream for Backend Wordpress Blogs
September 29, 2014 05:31AM
Access based on client IP address?

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Nginx - Upstream for Backend Wordpress Blogs
September 29, 2014 06:00AM
No, no restriction on the ip addresses
Re: Nginx - Upstream for Backend Wordpress Blogs
September 29, 2014 07:10AM
Oh my god. Got it. I check again the access log and..

127.0.1.1:80 1.2.3.4 - - [29/Sep/2014:11:04:44 +0000] "GET /wp-admin/admin.php?page=options-mediapage=options-media HTTP/1.0" 500

OK... " /wp-admin/admin.php?page=options-mediapage=options-media" realy realy bad from me.

my config:

proxy_pass http://backend$request_uri$args;

so, the $request_uri included already the $args and than wordpress fire a error...

*table + head* :)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 150
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready