"myapp.com"에서 실행중인 레일 응용 프로그램이 있습니다. 나는 "myapp.com/blog"에서 wordpress를로드하려고 시도했다.nginx는 워드 프레스 용 PHP를 처리 할 수 없습니다
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;
}
}
내가 <rails_root>/public/
에서 /home/deploy/wordpress/blog
에 워드 프레스 디렉토리 "블로그"를 이동하는 생각까지이 잘 작동 :이처럼 보이는 nginx를 구성으로 시작했다.
이렇게하려면 내 설정이 이랬습니다.
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;
}
}
이 후 php를 실행하는 대신 nginx가 php를 다운로드하기 시작했습니다. 누구든지 내가 잘못했을 수도있는 곳을 제안하거나 지적 할 수 있습니까?
당신의 답은 해결책을 찾는데 도움이되었습니다. –