准备

  • 域名:mall.com
  • 服务器:47.116.79.9 ```basic cd /mydata/nginx/conf [root@iZuf69te1lxhy9no8p7kdeZ conf]# ll total 36 drwxr-xr-x 2 root root 4096 Jan 30 21:21 conf.d -rw-r—r— 1 root root 1007 Jan 31 2017 fastcgi_params -rw-r—r— 1 root root 2837 Jan 31 2017 koi-utf -rw-r—r— 1 root root 2223 Jan 31 2017 koi-win -rw-r—r— 1 root root 3957 Jan 31 2017 mime.types lrwxrwxrwx 1 root root 22 Jan 31 2017 modules -> /usr/lib/nginx/modules -rw-r—r— 1 root root 643 Jan 31 2017 nginx.conf -rw-r—r— 1 root root 636 Jan 31 2017 scgi_params -rw-r—r— 1 root root 664 Jan 31 2017 uwsgi_params -rw-r—r— 1 root root 3610 Jan 31 2017 win-utf

    vi nginx.conf

upstream mall { server 192.168.56.1:88; //项目所在主机 }

  1. ![image.png](https://cdn.nlark.com/yuque/0/2021/png/1486377/1612062844422-77b62285-2108-4dd2-8f2e-078b2fbfaef4.png#height=628&id=TwUkP&margin=%5Bobject%20Object%5D&name=image.png&originHeight=628&originWidth=898&originalType=binary&size=48186&status=done&style=none&width=898)
  2. ```bash
  3. [root@iZuf69te1lxhy9no8p7kdeZ conf]# cd conf.d
  4. [root@iZuf69te1lxhy9no8p7kdeZ conf.d]# ll
  5. total 8
  6. -rw-r--r-- 1 root root 1097 Jan 31 2017 default.conf
  7. ##复制一份default.conf并改为mall.conf
  8. [root@iZuf69te1lxhy9no8p7kdeZ conf.d]# cp default.conf mall.conf
  9. [root@iZuf69te1lxhy9no8p7kdeZ conf.d]# ll
  10. total 8
  11. -rw-r--r-- 1 root root 1097 Jan 31 2017 default.conf
  12. -rw-r--r-- 1 root root 1067 Jan 30 21:21 mall.conf
  13. #修改mall.conf

image.png