【问题标题】:How to restrict access by NGINX basic_auth for every URL except one URL?如何限制 NGINX basic_auth 对除一个 URL 之外的每个 URL 的访问?
【发布时间】:2022-01-23 13:33:32
【问题描述】:

这是我的 nginx 的 sn-p:

     location / {
             # First attempt to serve request as file, then
             # as directory, then fall back to displaying a 404.
             try_files $uri /index.html;
             auth_basic "Private Property";
             auth_basic_user_file /etc/nginx/.htpasswd;
     }

     location /schedule {
             auth_basic off;
             proxy_pass http://localhost:25000;
     }

但是,在 /schedule 上,它显示在页面下方。如何解决这个问题?.

【问题讨论】:

  • 你在 Nginx 访问日志和 Nginx 错误日志中看到了什么?

标签: reactjs nginx nginx-reverse-proxy


【解决方案1】:

试试这个:

 location = /schedule {
         auth_basic off;
         proxy_pass http://localhost:25000;
 }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-29
    • 2011-11-11
    相关资源
    最近更新 更多