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