MacBook nginx 相关操作

sudo nginx     启动
sudo nginx -s reload      重新启动
ps -ef|grep nginx        查看nginx所在端口号
sudo kill -term  端口号        强制杀死nginx进程
查看和修改nginx配置文件 cmd+shift+g 前往 /usr/local/etc/nginx/ 进入此目录下

通过dist文件配置一套启动的环境,将dist文件放置到  /Applications/办公软件/nginx-1.10.3/html/agentAccount/dist 目录下,nginx配置文件的配置修改为

location / {
      root   html/代码目录名/dist/;
      index  login.html;
}
location =/personal.html {
    alias html/代码目录名/dist/personal.html;
}

其他:对于本地起的服务需要经过网关调用接口时,使用配置的server_name调用接口时,问题解决

1. https 要改成 http

2. 对于 listen 端口不是80的需要加上端口号

3. host 配置,是不是把server_name映射到本机的ip上了

4. 手机端使用的时候需要FQ,或者配置公司的网络

原文地址:https://www.cnblogs.com/lskzj/p/14242073.html