nginx - Ngix 配置不起作用。(阻止文件访问)
问题描述
我有一个简短的问题。我有这个 nginx 配置
server {
root /var/www/html/license/;
listen 80;
server_name here is my domain;
location ~ \.txt$ {
return 403;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
}
我的目标是阻止对所有 .txt 文件的访问!为什么这不起作用?一切都是正确的我做错了什么?
解决方案
推荐阅读
- python - Python sort links by latency
- javascript - 我为 Discord 机器人创建了一个重新加载命令,我希望能够重新加载新命令而不是预先存在的命令
- excel - excel function needs to be updated
- python - ERROR: Could not find a version that satisfies the requirement ipython==7.23.1
- javascript - Map through array of objects and pass props to specific component
- kotlin - Does FirebaseMessageingService.onMessageReceived need runBlocking when using coroutines?
- java - 从数组中删除项目时,for循环的作用是什么
- flutter - Flutter 视频压缩插件让视频尺寸更大
- python - m1 macos无法安装hdbcli
- reactjs - 为什么我的最后一个待办事项在第一次点击反应 redux 时没有被删除