免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2358 | 回复: 2
打印 上一主题 下一主题

[Web] nginx和htpasswd的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-19 14:48 |只看该作者 |倒序浏览
http://192.168.1.10/skins.php?page=2 这样可以访问,但是http://192.168.1.10/这样访问就要密码


我怎么设置http://192.168.1.10/skins.php?page=2 这样访问里也要密码?

配置文件

server
  {
    listen       10050;
    server_name  192.168.1.10;
    index index.html index.htm index.php;
    root  /var/htdocs/www/admin;
    autoindex on;
     location /  {
        auth_basic      "admin";
        auth_basic_user_file    /usr/local/webserver/nginx/conf/htpasswd/webadmin;
    }  
  
location ~ .*\.(php|php5)?$
    {
      #fastcgi_pass  unix:/tmp/php-cgi.sock;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      include fcgi.conf;
    }
   
            log_format  webadminlogs  '$remote_addr - $remote_user [$time_local] "$request" '
               '$status $body_bytes_sent "$http_referer" '
               '"$http_user_agent" $http_x_forwarded_for';
    access_log  /var/htdocs/logs/weiadminlogs.log  webadminlogs;
  }

论坛徽章:
0
2 [报告]
发表于 2009-08-19 14:49 |只看该作者
访问http://192.168.1.10/时需要密码(实现了我的要求),但是我访问http://192.168.1.10/index.php时就不需要密码了。。

论坛徽章:
0
3 [报告]
发表于 2009-09-02 18:16 |只看该作者
给你一个参考文章:
http://www.nginx8.cn/nginx/90/144.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP