I have a symfony site in / var / www / mysite / symfony and a WordPress blog in / var / www / mysite / wordpress. How can I submit mysite.com/blog to WordPress and all other symfony requests? Here is what I have tried so far:
server {
server_name mysite.com;
root /var/www/mysite/symfony/web;
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
}
location ~ ^/blog {
root /var/www/mysite/wordpress;
try_files $uri $uri/ /blog/index.php?$args;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
}
}
access_log /var/log/nginx/mysite-access.log;
error_log /var/log/nginx/mysite-error.log;
}
In this configuration, I get "File not found". error visiting mysite.com/blog. In my log file, nginx is displayed FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream. I know that this is not a problem with setting up php-fpm, since Symfony works fine with my site root.
Where am I going wrong?
source
share