nginx在mac下的安装与基本操作

 

1. 安装

brew install nginx(需要安装homebrew)

 

2. 执行  nginx

直接启动nginx服务

 

3. nginx -s  reload/stop

4. 配置地址

sudo vim /usr/local/etc/nginx/nginx.conf

5. 修改根目录地址

location/ {
     root: /home/xxx;
     index:index.htm index.html;  
}

6. 反向代理

可以代理tomcat的服务。

location/  xxx/{
     proxy_pass  http://xxxx; 
}

  

 

posted on 2016-11-08 10:36  愤怒的菜鸟  阅读(322)  评论(0编辑  收藏  举报

导航