negix反向代理: 1.实现效果:打开浏览器,输入www.123.com 跳转到linux系统主页面中 2.准备工作tomcat java环境 https://www.cnblogs.com/q1359720840/p/14130845.html 3.安装号java 和使用tar -cxf xxx.tar.gz解压文件后 4.启动tomcat bin目录: ./start.sh 5. http://xxxx:8080/ 6.查看后台输出日志 cd logs tail -f catalina.out 7.找到本地host文件目录设置hosts内容 http://81.68.167.173 www.123.com 8.启动nginx 9.修改nginx的conf中的配置 首先在server中的server_name原本的localhost改成ip吧。 然后将location /{ 新增:转发端口 proxy_pass http://127.0.0.1:8080; } 10.弄完之后提示我备案否则不能访问,日了 11.本地玩win10的吧。。。。。 12. 进入win10 nginx目录:start nginx
location / { proxy_pass http://127.0.0.1:8080; }