14 nginx

时间:2020-03-31 15:34:46   收藏:0   阅读:64

问题

nginx的作用是什么

答案

upstream fuzai{
    server 127.0.0.1:8080;
    server 127.0.0.1:8081;
    ip_hash;
    }
   # 将server节点当中的第一个location节点修改为以下内容:
    location / {
       root   html;
       index  index.html index.htm;
    proxy_pass http://fuzai
   }
      #拦截动态请求
      location / {
        proxy_pass http://localhost:8080;
      }

      #拦截静态资源
      location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|js|css)$ {
        root /opt/static;
       }

原文:https://www.cnblogs.com/alichengxuyuan/p/12605387.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!