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 重置配置文件
转载于:https://blog.51cto.com/1175667160/1542446
本文提供了一个Nginx服务器的配置示例,包括监听端口、域名设置、根目录定位、FastCGI配置及认证机制等内容。
1925

被折叠的 条评论
为什么被折叠?



