Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
nginx,为静态文件提供身份验证_Nginx_Aiohttp - Fatal编程技术网

nginx,为静态文件提供身份验证

nginx,为静态文件提供身份验证,nginx,aiohttp,Nginx,Aiohttp,我正在开发一个web应用程序,其中用户身份验证是通过实现的。我用于服务器部署。该配置受的启发如下: location /api { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; proxy_buffering off; proxy_pass http://127.0.0.1:8080/api;

我正在开发一个web应用程序,其中用户身份验证是通过实现的。我用于服务器部署。该配置受的启发如下:

location /api {
  proxy_set_header Host $http_host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;
  proxy_buffering off;
  proxy_pass http://127.0.0.1:8080/api;
}
web应用程序的一部分类似于相册。我希望这些照片由ngninx提供用于表演。我的配置现在看起来像,它可以工作,但绕过了身份验证:

location /photos {
  root /srv/web/photos/;
  try_files $uri =404;
}
如何使
nginx
仅向经过身份验证的用户提供照片?(python应用程序正在实现身份验证机制,如上所述)

刚刚找到(不知道我以前为什么错过了它)