nginx給http加驗證

server {

        listen       80;

        server_name  localhost;



        #charset koi8-r;


        #access_log  logs/host.access.log  main;


        location / {

            root   html;

            index  index.html index.htm;


            location ~ .*\.(php|php5)?$ {

            fastcgi_pass unix:/tmp/php-cgi.sock;

            fastcgi_index index.php;

            include fastcgi.conf;

            }


            auth_basic "Authorized users only";

            auth_basic_user_file /usr/local/nginx/conf/auth.conf;

            }




/sbin/nginx -t  查看配置文件對不對

/sbin/nginx -s reload   重置配置文件

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章