# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
3. Nginx常用命令
#测试nginx配置:
nginx -t /usr/local/nginx/conf/fzjh.conf
#启动、关闭
./sbin/nginx # 默认配置文件 conf/nginx.conf,-c 指定配置文件启动
./sbin/nginx -s stop
或 pkill nginx
#重启,不会改变启动时指定的配置文件
./sbin/nginx -s reload
CentOS 6.8 安装LNMP环境(Linux+Nginx+MySQL+PHP)
Linux下安装PHP环境并配置Nginx支持php-fpm模块
Ubuntu 16.04上启用加密安全的Nginx Web服务器