nginx 的用法

一 安装

安装请参看:https://blog.csdn.net/Janson_Lin/article/details/107529341

1
2
3
1, 下载稳定版
2, 双击运行exe,输入localhost
3,若是没有出现ngnix页面,可以修改conf文件下的nginx.conf文件的端口

start E:\nginx-1.10.2\nginx.exe -c E:\nginx-1.10.2\conf\nginx-2.conf 

 

Access to fetch at 'http://localhost:3000/'   from origin  'http://localhost:8083"

 #在server中做如下修改
     server {
         listen       8081;   #这里是nginx监听端口
         server_name  http://www.forus616.cn;
         
         location / {
             proxy_pass http://www.forus616.cn:4200; 
             #这个是代理,说明这个代理服务器的默认路径/是 http://www.forus616.cn:4200
         }
         location /api {
             proxy_pass http://www.beauty.com/api;
             #这个是代理,说明这个代理服务器的路径/api是http://www.beauty.com/api
         }
    }

  

 查看多少个nginxtasklist /fi "imagename eq nginx.exe

运行命令:                 taskkill /f /t /im nginx.exe 关闭nginx其他服务,这样才能彻底关闭

 查看修改成功了?: nginx -t -c F:\nginx-1.22.0\conf\nginx.conf

 nginx -s   stop  ,nginx -s quit

常见的错误:

(1)端口号被占用

(2)nginx文件夹路径含中文

 

posted @   lxq3280  阅读(65)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 提示词工程——AI应用必不可少的技术
· 字符编码:从基础到乱码解决
· 地球OL攻略 —— 某应届生求职总结
点击右上角即可分享
微信分享提示