日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

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

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

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

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

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

現(xiàn)在修改后的配置文件如下所示:

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

}}

總結(jié)

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

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。