WordPress.org

Ready to get started?Download WordPress

Forums

nginx rewrites for mu (1 post)

  1. tofutim
    Member
    Posted 3 years ago #

    Help! I've setup mu subdirectory and I'm running into issues where the child site php are not resolving properly. When I go to mysite.com/subsite/*.php, I keep getting the dreaded No input file specified. I am using php5-fpm and nginx.

    server{
            listen 443 default ssl;
            ssl_certificate         /etc/ssl/certs/myserver_crt.pem;
            ssl_certificate_key     /etc/ssl/private/myserver_key.pem;
            keepalive_timeout       70;
    
            server_name mysite.com; #change this to the domain name, for example$
            access_log /var/log/wordpress.access_log;
            error_log /var/log/wordpress.error_log;
    
            server_name_in_redirect off;
            port_in_redirect off;
    
            location / {
              root /var/www/wordpress;
              index index.php index.html index.htm;
    
              # this serves static files that exist without running other rewrite t$
              if (-f $request_filename) {
                  expires 30d;
                  break;
              }
    
              # multisite
              rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
    
              # this sends all non-existing file or directory requests to index.php
              if (!-e $request_filename) {
    #               rewrite ^.+?(/.*\.txt)$ $1 last;
                    rewrite ^.+/?(/wp-.*) $1 last;
                    rewrite ^.+/?(/.*\.php)$ $1 last;
                    rewrite ^(.+)$ /index.php?q=$1 last;
              }
            }
    
            location ~ \.php$ {
                fastcgi_pass    127.0.0.1:9000;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME /var/www/wordpress$fastcgi_script_n$
                include         /etc/nginx/fastcgi_params;
            }
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.