I have a rails app running at say "myapp.com". I tried to load wordpress at "myapp.com/blog". I started off with an nginx configuration that looks like this:
server {
passenger_enabled on;
passenger_app_env staging;
server_name myapp.com;
root /home/deploy/myapp/current/public;
location /blog {
passenger_enabled off;
root /home/deploy/myapp/current/public;
index index.php index.html index.htm;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
This worked fine until I thought of moving wordpress directory "blog" from <rails_root>/public/
to /home/deploy/wordpress/blog
.
To do that my config was this.
server{
location ^~ /blog{
root /home/deploy/wordpress;
passenger_enabled off;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location / {
passenger_enabled on;
root root /home/deploy/myapp/current/public;
passenger_app_env staging;
}
}
After this, instead of executing php, nginx started downloading php. Can anyone suggest or point out where I might have gone wrong?