Nur*_*jan 0 url nginx redirect
我需要将 url 重定向到位于文件系统上的 html 文件。这是我迄今为止尝试过的:
location /this/some/url {
alias /path/to/the/file.html
}
Run Code Online (Sandbox Code Playgroud)
当我运行它时,重定向工作但浏览器尝试下载 html 文件。相反,我希望它在浏览器中呈现 html 页面。
location /this/some/url {
index file.html;
alias /path/to/the/;
}
Run Code Online (Sandbox Code Playgroud)
请阅读别名:https : //nginx.ru/en/docs/http/ngx_http_core_module.html#alias
关于索引文件:https : //nginx.ru/en/docs/http/ngx_http_index_module.html
一切都变得清晰起来。
| 归档时间: |
|
| 查看次数: |
5034 次 |
| 最近记录: |