0
WordPress的我有example.com上運行的Django的,我需要一個WordPress添加到我的服務器,將example.com/blog,也許是行不通的(404錯誤):Django和Nginx的上404錯誤
listen 80;
server_name www.example.com;
location ^~ /blog/ {
root /www/blog;
index index.html index.htm index.php;
try_files $uri =404;
location ~ \.php {
root /www/blog;
fastcgi_split_path_info ^(.*\.php)(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
}
}
location/{
uwsgi_pass unix:/tmp/myapp.sock;
include /www/webapp/system/uwsgi_params; # the uwsgi_params file you installed
uwsgi_read_timeout 300;
}
WordPress的文件夾是/www/blog/index.php但nginx的是 「/usr/share/nginx/htmlindex.php」 – user2925795
@ user2925795我想你應該讓搜索/中的index.php?但我不知道你爲什麼會變得404。 – levi
是給予404因爲他搜索「/usr/share/nginx/htmlindex.php」中的WordPress的...他應該看看/ www/blog /我怎麼改變這個? – user2925795