当permalink设置为plain
一切正常。但当我把permalink改为post name
仅Wordpress主页(dev.site.com/blog
) 工作正常,但对于其他页面(例如。,dev.site.com/blog/first-page
) 它将重定向到dev.site.com
.
server {
listen 80;
listen [::]:80;
root /var/www/wordpress-site;
index index.php index.html index.htm index.nginx-debian.html;
server_name dev.site.com www.dev.site.com;
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location /blog {
alias /var/www/wordpress-site/;
try_files $uri $uri/ /blog/index.php?$args;
location ~ \\.php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}
# angular project
location / {
root /home/user/angular-project;
try_files $uri $uri/ /index.html;
}
location ~ /\\.ht { deny all; }
}
我试着换衣服
try_files
, 但还是不行
谢谢:)