我通常使用Nginx在服务器上提供静态内容,Apache使用PHP-FPM处理PHP内容。然而,我无法显示Wordpress的博客主页,我已经尝试了在web上找到的所有配置示例,但运气不好。
这是我的Nginx配置:
server {
listen XXX.XXX.XXX.XXX:80;
server_name wptest.mydomain.com;
access_log /var/log/nginx/testblog_access.log combined;
error_log /var/log/nginx/testblog-error.log;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
proxy_pass http://127.0.0.1:80;
}
location = /50x.html {
root /var/www/nginx-default;
}
# No access to .htaccess files.
location ~ /\\.ht {
deny all;
}
}
我的Apache配置如下:<VirtualHost 127.0.0.1>
ServerName wptest.mydomain.com
ServerAdmin webmaster@mydomain.com
LogLevel warn
ErrorLog /var/log/apache2/testblog-error.log
CustomLog /var/log/apache2/testblog-access.log combined
Options +FollowSymLinks +ExecCGI -Indexes -MultiViews
AddHandler php-fastcgi .php
Action php-fastcgi /wordpress
Alias /wordpress /var/www/wordpress
FastCgiExternalServer /var/www/wordpress -host 127.0.0.1:9000
RewriteEngine on
DocumentRoot /var/www/wordpress
DirectoryIndex index.php
<Directory />
DirectoryIndex index.php
AllowOverride All
Options +FollowSymLinks +ExecCGI +SymLinksIfOwnerMatch
</Directory>
<Directory /var/www/wordpress>
AllowOverride All
Options +FollowSymLinks +ExecCGI +SymLinksIfOwnerMatch
</Directory>
</VirtualHost>
我无法查看“http://wptest.mydomain.com/“或”http://wptest.mydomain.com/wp-admin“但是”http://wptest.mydomain.com/wp-login.php“行得通。我做错了什么?版本信息:+OS:Debian5/Lenny+Apache:2.2.9+Nginx:0.7.65+Wordpress:3.1.2