nginx - Nginx 位置未解析
问题描述
我试图让我的 nginx 实例主机来自两个单独的静态文件。
根路径的配置有效,但使用任何其他前缀模式会导致 404 未找到。
配置如下:
server {
listen 80;
server_name *.saurabhharwande.com;
root /var/www/certbot;
location /abc/ {
index vindex.html;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
www.saurabhharwande.com/abc给 404
我错过了什么吗?
编辑:我对 nginx 配置工作原理的基本理解是有缺陷的。我认为索引文件是在根本身 /<domain>/<root>/index.html 中搜索的,并且位置仅用于指向不同的根。而是在 <domain>/<root>/<location>/index.html 进行搜索
解决方案
推荐阅读
- excel - 如何将特定页面从单个工作表导出为 pdf?
- maven - 如何覆盖 pom.xml 文件中的 testCaseProperties,如 projectProperties 或 testSuiteProperties?
- python - Python - 匹配单词但不匹配单词旁边的另一个单词
- c# - 如何在需要时创建棱镜的视图模型?
- excel - 使用 IF 和 AND 函数
- android - 推到新屏幕后底部导航栏未隐藏
- python - csv.read 不尊重字符串中的引号
- gensim - gensim doc2vec 嵌入向量中的差异
- java - 生成并读取 base64 私钥以从 java 签署 JWT 令牌
- python - 将宽表格式更改为长表格式并按年份拆分日期