網(wǎng)站首頁 編程語言 正文
記一個nginx錯誤directory index of “/var/www/xxxx/“ is forbidden,
作者:crayon-shin-chan 更新時間: 2022-02-22 編程語言1.簡介
配置nginx訪問wordpress,root為wordpress根目錄
訪問首頁報錯
directory index of "/var/www/wordpress/" is forbidden,
2.解決
nginx本身有index指令,而默認(rèn)的index里是不包含index.php的
index index.html index.htm index.nginx-debian.html;
但是wordpress的入口是index.php
所以直接不加任何path訪問域名,會因為找不到匹配的index而報錯
此時只需要把wordpress的入口加入到index指令后,然后重載nginx即可
index index.php;
還有一種方式,并不適合這種情況,就是當(dāng)你要訪問這個路徑下文件目錄時,開啟自動索引
autoindex on;
此時如果index匹配失敗,會顯示當(dāng)前文件目錄
原文鏈接:https://blog.csdn.net/qq_27868061/article/details/120720480
相關(guān)推薦
- 2022-05-20 Kafka 認(rèn)證登錄注意事項
- 2021-12-07 C語言SetConsoleTextAttribute函數(shù)使用方法_C 語言
- 2022-05-25 SpringCloud和微服務(wù)之間的關(guān)系
- 2024-01-28 ThreadLocal,提供線程局部變量
- 2022-06-21 詳解C#中檢查null的語法糖_C#教程
- 2022-10-02 詳解R語言caret包trainControl函數(shù)_R語言
- 2023-02-17 Python去除字符串前后空格的三種方法匯總_python
- 2022-04-10 為Xamarin.Forms的導(dǎo)航欄增加搜索功能_C#教程
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支