nginx学习

1.反向代理与负载均衡

   1.nginx端口:80

   2.关闭:./nginx -s stop

         ./nginx -s start

   3.重新加载:./nginx -s reload

   4.修改nginx文件配置问题:

    1.在本地编辑

    2.打开权限设置。(chmod 777)

    3.上传。

   5.输入命令

    ctrl + shift +p:打开命令

   6.解压文件

    1.安装unzip

      yum install -y unzip zip

    2.unzip 文件名

   7.重启nginx系统

   8.域名限定

    1.打开windows/system32/etc/hosts文件

##正题:

    1.正向代理

    

 

    2.配置反向代理

      

 

     配置反向代理文件:      

      upstream tomcat-travel{

              server 192.168.177.129:8080;

          }

         server {

              listen       80; # 监听的端口

              server_name  www.hmtravel.com; # 域名或ip

              location / {      # 访问路径配置

                 # root   index;# 根目录

                 proxy_pass http://tomcat-travel;

                 index  index.html index.htm; # 默认首页

              }

        }

      3.负载均衡

        

 

posted @ 2020-07-25 22:13  huxiaojie  阅读(69)  评论(0编辑  收藏  举报