PHP-FPM and NGINX with Wordpress redirect (sometimes) to weird url and blank page

Posted September 15, 2020 1.7k views

I followed many tutorials here and thanks to the community I was able to set up a LEMP stack, running on Debian 10 with Nginx 1.18, php 7.4.9, WP5.5.1 Multisite.
Everything is working very well but one thing, which is driving me crazy.
I have no errors and all the redirections work flawlessy but whenever i got into the admin page and i try to create a new site… it redirect to the very same page (like a refresh) and nothing happen. The url in the address bar is weird:


The same problem appears whenever i try to upload a plugin or a theme… blank page and that url:


And again… let’s try with a plugin! Err.. NO, again a blank page and the strange duplicate url:


Here’s a closer look to the console

scheme  https
filename    /wp-admin/network/update.php
action  upload-plugin

Yes! that’s cool. Let’s see what’s next.


Seems legit, you know where you are. How do you think he’s going to answer to this?


Wait… there’s something wrong here…
Oh… there’s some sort of echo? a deaf client assistant-rewrite?

I’m hitting a wall here, I don’t know where to look for errors, there’s nothing in error_log. Php ini’s, fpm config and nginx blocks they all look just fine to me.
What could it be? Please help me, I feel like my head’s about to explode.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @pietroOP,

I’ll recommend starting with your redirection rules in your Nginx blocks. If they are alright, then I’ll turn my attention to the plugins I already have installed.

Most often than not, a plugin in WordPress is making such strange behaviors of your website. Start by disabling plugins all at once and seeing if the issue is still being experienced. If it isn’t, you’ll need to enable your plugins one by one to see when the issue will repeater.

Usually, I’ll suggest checking plugins like Real Simple redirections or something related to SSL.


  • I have 3 server blocks, the first is for simple redirection from NO-WWW to WWW

    server {
    rewrite ^/(.*)$ https://www.$host$request_uri permanent;
        listen 443 ssl http2; #more line for certificates

    the second is for all the domains and subdomains:

    server {
            root /dir/dir/dir/dir/;
            index index.php;
    location / {
            try_files $uri $uri/ /index.php;
    ##Trailing slash to wp-admin requests
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
          location ~ [^/]\.php(/|$) {
            include snippets/fastcgi-php.conf;
            include fastcgi_params;
            fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    location ~ ^/\.user\.ini {deny all;}
    location ~* \.(txt|xml|js|css|png|jpg|jpeg|gif|ico|svg|swf|webp|pdf|svg|flv|avi|mov|ppt|doc|mp3|wmv|wav){
    expires 1y;
    log_not_found off;
        listen 443 ssl http2; #more line for certificates

    third is for HTTPS redirect:

    server {
    listen 80;
            return 301 https://$host$request_uri;
  • Furthermore, I don’t have any redirection or SSL plugins. I tried to disable all websites, all plugins and revert to main theme and still nothing changes.