nginx 基本身份验证不适用于 Windows

标签 nginx basic-authentication

这是我的nginx conf(window2003服务器)的一部分

server {
  listen 80;
  server_name  xxx.example.com;
  access_log  logs/example.com.log;

  location / {
    auth_basic  "Restricted";
    auth_basic_user_file  c:/xxx/password_file;
    proxy_set_header  Authorization "";
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass   http://127.0.0.1:3000/xx/;
  }
}

访问xxx.exmaple.com网站提示我输入用户名和密码(正确),反复提示此提示。

  1. password_file is created by htpassword command on Mac OS.
  2. http://127.0.0.1:3000/xx/ proxy for tomcat application .
  3. nginx version is 1.7.12 for window.

可能是 HttpBasicAuthModule with nginx 不支持 windows 平台?

最佳答案

它的;

auth_basic  "Restricted";
auth_basic_user_file  c:/xxx/password_file;

参见 http://forum.nginx.org/read.php?2,254125,254187#msg-254187

关于nginx 基本身份验证不适用于 Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30757477/

相关文章:

nginx - 配置 nginx 以防止 Cloudbees 中超时

magento - 如何在 ubuntu localhost 上使用 magento 配置 nginx

javascript - 无法在 ember 中向后端服务器发出请求(错误 :'No Access-Control-Allow-Origin' )

node.js - 像 php 一样从 nginx 提供 nodejs 应用程序?

docker - Docker编写Nginx,Express,Lakeencrypt SSL获得502 Bad gateway

python - Flask HTTP Basicauth - 它是如何工作的?

AngularJS 基本身份验证

jquery - 使用 JQuery 在 Internet Explorer 中进行 CORS 身份验证

basic-authentication - 预渲染 basicAuth 配置

rest - 在 Restful Web 服务中如何以编程方式获取用户名或密码(基本身份验证)