我使用Nginx作为python WSGI web应用程序的反向代理。 它看起来像这样: location / { #auth_basic "Administrator Login"; #auth_basic_user_file /var/www/static/.htpasswd; proxy_pass http://mywebapp_gunicorn; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } 在Web应用程序内部,我有一些pipe理员页面,我希望得到很好的保护,所以现在我在Web应用程序中使用一些authentication来保护他们,我想添加Nginxauthentication。 如何激活: auth_basic "Administrator Login"; auth_basic_user_file /var/www/static/.htpasswd; 对于path: /managers ,但不适用于所有其他URL。
我有几个网站的目录受到http基本身份validation的保护,通过.htaccess文件与.htpasswd文件配对实现。 我注意到,以“et!”结尾的密码 我可以通过省略“t!”来进入,或者replace! 一个1。 我的.htaccess文件的内容: AuthType Basic AuthName "administration" AuthUserFile /var/www/conf/mysitename.com.pw require valid-user 我在mysitename.com.pw有两个用户。 显然这种行为是不希望的。 任何想法发生了什么?
我有apache作为后端和nginx作为前端。 有些内容由Apache(HTTP Auth)进行密码保护。 当我直接访问它 – 一切工作正常,bur当我尝试通过nginx – 似乎nginx不会转发或caching来自Apache的响应。 所以在nginx日志里面我看到: 89.21.92.0 – – [17/May/2012:22:13:42 +0200] GET / HTTP/1.1 | upstream_address xxxx:80 | upstream_status 401 | upstream_response_time 0.026 | msec 1337285622.757 | request_time 0.026 89.21.92.0 – zentavr [17/May/2012:22:13:44 +0200] GET / HTTP/1.1 | upstream_address – | upstream_status – | upstream_response_time – | msec 1337285624.151 | request_time 0.000 […]
curl似乎工作正常,但git没有。 git要求input密码,但是不会发送任何凭据。 作品: curl –netrc http://test.git.unsw.edu.au/和curl -u username:password http://test.git.unsw.edu.au/ 不起作用: git remote update Password for 'http://[email protected]': * Couldn't find host test.git.unsw.edu.au in the .netrc file; using defaults User-Agent: git/1.7.9.5 Host: test.git.unsw.edu.au Accept: */* Pragma: no-cache 为什么不是git发送凭据? 从一个strace,我看到: 阅读.netrc GET /repo/info/refs?service=git-receive-pack HTTP/1.1 – 没有证书 HTTP/1.0 401 Unauthorized 阅读.netrc GET /repo/info/refs?service=git-receive-pack HTTP/1.0 – 无凭据 HTTP/1.0 401 Unauthorized […]
我试图保护只有我的主页与Apache基本身份validation。 这似乎在不仅仅是惠普的一切工作 <LocationMatch "/"> AuthType Basic AuthName "heelooo?" AuthUserFile /var/path/.htpasswd Require valid-user </LocationMatch> 将正则expression式更改为^/$或^$使其不validation任何内容。 有小费吗? (它运行一个mod_ruby rails应用程序)
当检查我的一些客户的日志文件时,我发现这是用户名authentication的用户。 我们有一个用于基本Webauthentication的.htusers文件,我在.htusers中find的.htusers中的所有其他用户,而不是@^Y@.@{phqsp~{2'/2|pq{jvk@-1('@lvo)&1–1.(/1)'@./* user。 64b Opensuse 12上的服务器版本是2.2.22 第一个问题:这个用户是否能够接收由.htusers文件保护的内容? 下一个:任何人有更多关于这个磨合尝试的信息? 除了来自世界各地的大量访问日志外,我在Google上没有发现任何内容。 编辑:只要添加logentries: xyzx – @^Y@.@{phqsp~{2'/2|pq{jvk@-1('@lvo)&1–1.(/1)'@./* [06/Jan/2013:16:53:16 +0000] "GET xxxxxxxxxxxxxxx HTTP/1.1" 200 676 "xxxxxxxxxxxxxxx" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11" xyzx – @^Y@.@{phqsp~{2'/2|pq{jvk@-1('@lvo)&1–1.(/1)'@./* [06/Jan/2013:16:53:16 +0000] "GET xxxxxxxxxxxxxxx HTTP/1.1" 200 523 "xxxxxxxxxxxxxxx" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11" xyzx […]
我知道这似乎是一个简单的任务,我为Apache 2.0-2.2做了很多次,但在2.4configuration不起作用。 我正在尝试configurationdirectiry的基本身份validation: <Directory /var/www/html/docs> AuthType Basic AuthName Documents AuthBasicProvider file AuthUserFile /etc/apache2/.iRedMail Require valid-user </Directory> logging文件,当我打开并input正确的密码: [Sun Aug 17 10:51:17.817681 2014] [authz_core:debug] [pid 14318] mod_authz_core.c(802): [client 37.229.191.182:52066] AH01626: authorization result of Require valid-user : denied (no authenticated user yet) [Sun Aug 17 10:51:17.818377 2014] [authz_core:debug] [pid 14318] mod_authz_core.c(802): [client 37.229.191.182:52066] AH01626: authorization result of […]
为了实现基本的身份validation与Apache服务器和插件的代理部分工作很好,但是当我尝试瓶坯请求,假设触发mod_authn_dbd及其依赖项的即时通讯得到这个错误: [Sat Sep 03 17:42:38 2011] [error] (OS 126)The specified module could not be found. : DBD: failed to initialise [Sat Sep 03 17:42:38 2011] [error] [client 192.168.16.2] Failed to acquire database connection to look up user 'admin' 这里是我的configuration: <VirtualHost 133.133.16.2:8090> ServerAdmin ed_mann@dont_spam_me.ok DBDriver mysql DBDParams "host=localhost port=3306 dbname=test user=root pass=root" DBDMin 1 DBDKeep 8 […]
我正在构build一个基于OpenVPN的系统,在这个系统中,客户端将连接到一个网站,通过基本身份validation进行保护(就是这样,没办法改变这个)。 我希望我可以通过一个nginx的代理,在我到达网站之前为我添加正确的基本authentication头。 这样,根据客户端使用的IP地址(来自OpenVPNconfiguration),我将检索它的用户名/密码在数据库中,并相应地伪造标题。 所以用户不必input任何login/密码。 注入基本身份validation标头很容易: location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://6.6.6.6:80; proxy_set_header Authorization "Basic a2luZzppc25ha2Vk"; } “a2luZzppc25ha2Vk”当然是这个login名的密码:base64。 所以现在我需要用数据库中的值replacea2luZzppc25ha2Vk,根据$ remote_addr
尝试使用Apache设置基本的HTTP身份validation,但它不起作用。 我定期得到目录列表和文件,不需要validation。 我尝试重新启动httpd和浏览器caching。 我在/ var / log / httpd / error_log中找不到任何相关条目。 有任何想法吗? htpasswd的: # htpasswd -c /usr/local/share/passwords username $ ls -l /usr/local/share/passwords -rw-r–r– 1 root root 44 Nov 23 13:29 /usr/local/share/passwords 的.htaccess: $ cat /srv/http/test/.htaccess AuthType Basic AuthName "Some Stuff" AuthUserFile /usr/local/share/passwords Require user username 目录: $ ls -la /srv/http/test/ total 16 drwxr-xr-x 2 root […]