網站首頁 編程語言 正文
記一個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指令,而默認的index里是不包含index.php的
index index.html index.htm index.nginx-debian.html;
但是wordpress的入口是index.php
所以直接不加任何path訪問域名,會因為找不到匹配的index而報錯
此時只需要把wordpress的入口加入到index指令后,然后重載nginx即可
index index.php;
還有一種方式,并不適合這種情況,就是當你要訪問這個路徑下文件目錄時,開啟自動索引
autoindex on;
此時如果index匹配失敗,會顯示當前文件目錄
原文鏈接:https://blog.csdn.net/qq_27868061/article/details/120720480
相關推薦
- 2022-07-01 C++中strlen函數的三種實現方法_C 語言
- 2022-06-20 關于go-micro與其它gRPC框架之間的通信問題及解決方法_Golang
- 2022-06-30 Oracle在PL/SQL中嵌入SQL語句_oracle
- 2022-05-10 二叉樹的遞歸和非遞歸遍歷
- 2022-07-09 C++深入探索內聯函數inline與auto關鍵字的使用_C 語言
- 2022-04-20 Python?設計模式行為型解釋器模式_python
- 2023-12-15 log4j.properties自定義日志配置
- 2022-05-17 qt 解決Error while building/deploying project Hmi (k
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支