我的这个环境几乎可以工作,但是永久链接和图像不起作用。
我的站点部署在 /var/www/staging-site/current/public;我的 Wordpress 博客部署在 /var/deployer/www/blog;
http {
server {
listen 80;
server_name www.mysite.com;
access_log logs/nosubdomain.access.log;
return 301 $scheme://mysite.com$request_uri;
}
server {
listen 80;
server_name mysite.com *.mysite.com;
#charset koi8-r;
access_log logs/subdomain.access.log;
root /var/www/staging-site/current/public;
location / {
passenger_enabled on;
rails_env staging;
root /var/www/staging-site/current/public;
}
location /blog/ {
root /home/deployer/www;
fastcgi_index index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /blog/index.php?q=$1 last;
}
fastcgi_param SCRIPT_FILENAME /home/deployer/www$fastcgi_script_name;
fastcgi_pass localhost:9000; # port to FastCGI
break;
}
location ~* ^/assets/{
root /var/www/staging-site/current/public;
expires max;
add_header Cache-Control public;
break;
}
}
我希望 www.mysite.com 显示我的网站,并希望 www.mysite.com/blog 显示 wordpress 博客。它可以工作,但链接不起作用。例如http://mysite.com/blog/wp-content/uploads/2012/04/bname-268x300.jpg&w=150&h=150&zc=1&q=90不显示图像,即存在,它显示了根博客。
有什么帮助吗?