Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter davidossahdez

    (@davidossahdez)

    Hey Pothi, thanks! I didn’t know that I can nest location blocks. Thank you for your advice it was VERY helpful. I made some changes to make this work. Take a look:

    location ~ ^/name-of-the-theme/demo {
            # Points to another WordPress installation
            root /srv/www/themes.example.com/themes;
            try_files $uri $uri/ /index.php?$args;
    
            location ~ \.php$ {
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    include fastcgi_params;
            }
    }

    The location block needs to use a regular expression because all the files (stylesheets, scripts and images) need to be redirected too. I was getting a 404 error with your code. The HTML loads correctly, but the resources don’t. That little tilde makes the difference 😀

    I had the same problem until I installed php5-gd package. Just double check if you have it installed. http://packages.debian.org/sid/php5-gd

Viewing 2 replies - 1 through 2 (of 2 total)