我刚刚在 ubuntu 14.04 LTS 上安装了 wordpress。 Nginx 充当 apache2 的反向代理。
wp-admin 工作正常,但我无法打开主页。
Nginx 服务器代码:
server {
listen 80;
root /var/www/html/testblog;
index index.php index.html index.htm;
server_name testblog.com;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8182;
}
location ~ /\.ht {
deny all;
}
}
Apache 虚拟主机会议:
<VirtualHost *:8182>
ServerName testblog.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/testblog
ErrorLog ${APACHE_LOG_DIR}/errortest.log
CustomLog ${APACHE_LOG_DIR}/accesstest.log combined
</VirtualHost>
我的/etc/hosts:
127.0.0.1 localhost
127.0.0.1 ubuntu
127.0.1.1 testblog.com
我的所有 wp 文件都在文件夹 /var/www/html/testblog/ 中。
testblog.com/wp-admin:工作正常。
testblog.com:给出了太多的重定向。
这是我的设置页面: https://i.stack.imgur.com/NNfpN.png
我想我的设置是正确的。我尝试在 wp-config.php 中定义 WP_HOME 和 WP_SITEURL,但没有成功。
我的/var/www/html/testblog/.htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
testblog.com/wp-admin:工作。
testblog.com:给出太多重定向错误
非常感谢任何帮助。
Edit:我已经禁用了所有插件。