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 } }
查看多少个nginx : tasklist /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文件夹路径含中文
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 提示词工程——AI应用必不可少的技术
· 字符编码:从基础到乱码解决
· 地球OL攻略 —— 某应届生求职总结