日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

wordpress拒绝访问_Nginx + Wordpress页面或帖子URL返回拒绝访问

發布時間:2023/12/10 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 wordpress拒绝访问_Nginx + Wordpress页面或帖子URL返回拒绝访问 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

謝謝你的答案@ r3wt。但是,我猜上面的配置文件是不合適的我不想保持原樣(但是對于我來說開發似乎沒問題,因為部署我寧愿為每個站點使用單獨的配置文件)。

所以,別名部分和我的問題應該正確定義try_files因為我想要捕獲鏈接以localhost / szpetra開頭所以我添加它并取消注釋別名部分因為現在我清楚地了解root和別名whis之間的區別是什么是:

This will result in files being searched for in /foo/bar/bar as the full URI is appended.

location /bar {

root /foo/bar;

}

This will result in files being searched for in /foo/bar as only the URI part after /bar is appended.

location /bar {

alias /foo/bar;

}

資料來源:https://forum.nginx.org/read.php?2,129656,130107

現在修改后的配置文件如下所示:

server {

listen 80;

server_name localhost;

access_log /var/log/nginx/localhost-access_log main;

error_log /var/log/nginx/localhost-error_log info;

root /var/www/localhost/htdocs/;

index index.php index.html index.htm; # I used index definition here so I think I shouldn't define it under a 'location' field.

location ~ \.php$ {

try_files $uri =404;

include /etc/nginx/fastcgi.conf;

fastcgi_pass unix:run/php-fpm.socket;

}

location /phpmyadmin {

alias /var/www/localhost/htdocs/phpmyadmin;

access_log /var/log/nginx/phpmyadmin-access_log main;

error_log /var/log/nginx/phpmyadmin-error_log info;

}

location /samplewordpress {

alias /var/www/localhost/htdocs/samplewordpress;

access_log /var/log/nginx/samplewordpress-access_log main;

error_log /var/log/nginx/samplewordpress-error_log info;

}

location /szpetra {

# alias /var/www/localhost/htdocs/szpetra; #uncommenting alias helped me solve the problem

access_log /var/log/nginx/szpetra-access_log main;

error_log /var/log/nginx/szpetra-error_log info;

# index index.php index.html index.htm; # this doesn't need cause I defined the indexes above in the server{} section but I'm not sure that about this

try_files $uri $uri/ /szpetra/index.php?$args; # Adding this line helped me solve the problem

}}

總結

以上是生活随笔為你收集整理的wordpress拒绝访问_Nginx + Wordpress页面或帖子URL返回拒绝访问的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。