AMH 社区首页
AMH社区 - 开放自由有价值的社区
	
		
    	 | 
	|
|---|---|
| 
	
	 瑞子  | 
	
	 
		  瑞子 发表于 2014-09-06 21:09:30
	 
	这个是amh 面板/usr/local/nginx/conf/vhost 对应的配置文件。 我想在这个网站的xxx.xxx.com/123 文件夹加入密码访问保护,类似apache 的。但是不知道nginx 怎么搞? 听说:对某个文件夹密码保护要写款套格式的location? server 
		{ listen 80; server_name xxx.xxx.com; #server_name end index index.html index.htm index.php; #index end set $subdomain ''; root /home/wwwroot/xxx.xxx.com/web$subdomain; include rewrite/amh.conf; #rewrite end #error_page error_page 400 /ErrorPages/400.html; error_page 403 /ErrorPages/403.html; error_page 404 /ErrorPages/404.html; error_page 502 /ErrorPages/502.html; location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$ { root /home/wwwroot/xxx.xxx.com/web; } location ~ .*\.php$ { fastcgi_pass unix:/tmp/php-cgi-xxx.xxx.com.sock; fastcgi_index index.php; include fcgi-host.conf; fastcgi_param DOCUMENT_ROOT /web$subdomain; fastcgi_param SCRIPT_FILENAME /web$subdomain$fastcgi_script_name; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$ { expires 30d; } location ~ .*\.(js|css)$ { expires 12h; } access_log off; #access_log end error_log /dev/null; #error_log end } 
				2014-09-06 21:09:30 1
	 
		
	 | 
	
| 
		
		 
		1024  | 
		 要自己搞 支持
				 
		
		
		回复 
		2014-09-06 22:33:26 2
		 
				
		 | 
		
| 
		
		 
		liudiary  | 
		  auth_basic_user_file /usr/local/nginx/passwd.db;
				 
		
		
		回复 
		2014-09-07 11:22:51 3
		 
				
		 | 
		
 HTTP
 
			[求助帖]
		求大神!求大神!帮忙写下nginx 密码目录保护