-
nginx 安装
-
进入 etc/nginx 目录下安装(没有新建)
-
yum install nginx
-
-
nginx启动
-
安装目录下 配置 nginx.conf
-
cd /etc/nginx
vim nginx.conf
location / { root /***/dist; //项目位置 尽量不要放root下,nginx好像访问不了 index index.html; try_files $uri $uri/ /index.html; } location /api { proxy_pass http://39.98.123.211; }
-
找到nginx安装目录下的sbin 执行(安装目录下没有去usr/sbin找nginx文件)
-
./nginx -c /etc/nginx/nginx.conf
-c 前面是 sbin下nginx位置, -c 后面是配置文件位置
-
-
nginx 进程查看
ps -ef | grep nginx
-
nginx 重启
同样再sbin目录下
./nginx -s reload
Linux nginx 项目部署
于 2022-03-19 10:58:26 首次发布