mac nginx 安装

安装

http://www.cnblogs.com/lping/p/5893567.html

brew search nginx

brew install nginx

安装完以后,可以在终端输出的信息里看到一些配置路径:

/usr/local/etc/nginx/nginx.conf (配置文件路径)

/usr/local/var/www (服务器默认路径)

/usr/local/Cellar/nginx/1.8.0 (安装路径)

访问localhost:8080,成功说明安装好了

启动报错pid无效解决办法

cd /usr/local/Cellar/nginx/1.12.1/bin
sudo nginx -c /usr/local/etc/nginx/nginx.conf
sudo nginx -s reload

http://www.cnblogs.com/tielemao/p/6163419.html

配置:

server {
    listen       80;                      #监听端口
    server_name  localhost;    #虚拟域名

    location / {
        proxy_pass http://localhost:8089;#转发域名
    }
}

配置详解:

http://www.cnblogs.com/hunttown/p/5759959.html

你可能感兴趣的:(mac nginx 安装)