我是WordPress的新手。我的环境是Ubuntu 18+Nginx+PHP 7。
遵循教程(https://www.myfreax.com/how-to-install-wordpress-with-nginx-on-ubuntu-18-04/), wordpress目录位于/var/www/html/device1.com
.
然后我配置nginx,下面是我的nginx配置:
server {
listen 80;
server_name www.device1.com device1.com;
server_name device1.com;
root /var/www/html/device1.com;
index index.php;
# log files
access_log /var/log/nginx/device1.com.access.log;
error_log /var/log/nginx/device1.com.error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires max;
log_not_found off;
}
}
但是,当我尝试连接到
http://device1.com/wp-admin/install.php
Nginx响应404,而不是返回wordpress安装页面。
我不想检查这个问题。谢谢你的建议。