1. 程式人生 > >nginx配置站點

nginx配置站點

配置了個nginx站點,用作研發人員傳包用。
在mac主機上安裝的,具體步驟就不說了,簡單講下配置檔案。

server {
    listen 8088;
    root /tmp/webroot;
    access_log /tmp/web.log;
    autoindex on;
    charset utf-8;
#    auth_basic "password !!";                                         ####這段是提示輸出密碼用的
#    auth_basic_user_file /usr/local/etc/nginx/servers/htpasswd;       ####這段是密碼存放位置
    }
	
	
	
	
auth_basic_user_file /usr/local/etc/nginx/servers/htpasswd   格式如下   admin:passwd
	
	
autoindex_exact_size on;  顯示人類可讀的大小
autoindex_localtime on;   顯示本地的時間
	
線上密碼生成工具
http://tool.oschina.net/htpasswd