使用Homebrew在Mac OS X EI Capitan上安装与配置nginx和PHP

安装nginx

brew install nginx

sudo nginx

测试安装

在浏览器打开下面的链接地址

http://localhost:8080

nginx.conf配置

    # 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;
    #    }
    #}
    include servers/*;
}

启动nginx

sudo nginx -c /usr/local/etc/nginx/nginx.conf

重启

sudo nginx -s reload

停止

sudo nginx -s stop

查看日志

/usr/local/var/log/nginx/access.log	

/usr/local/var/log/nginx/error.log


/usr/local/Cellar/nginx/1.10.0/logs/access.log

/usr/local/Cellar/nginx/1.10.0/logs/error.log

参考

http://www.jianshu.com/p/d65ef55a8e09

http://www.xuebuyuan.com/2174288.html

原文地址:https://www.cnblogs.com/tangyouwei/p/5505009.html