• nginx的简单反向配置


    公司开发环境不问题,每次开发总要重新配置下反向,总要麻烦后台大佬,后来自己试着配了几次也就那么回去,记录下来

    第一步 监听本地端口 

    listen 80;
    server_name 127.0.0.1;

    第二步  配置接口代理

    location /ws-microservice-backstage {
    proxy_pass http://192.168.0.105:8303;
    client_max_body_size 100m;
    client_body_buffer_size 2048k;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_connect_timeout 3;
    proxy_send_timeout 30;
    proxy_read_timeout 60;
    }

    第三步,页面代理

    location / {
    proxy_pass http://127.0.0.1:8091;
    client_max_body_size 100m;
    client_body_buffer_size 2048k;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_connect_timeout 3;
    proxy_send_timeout 30;
    proxy_read_timeout 60;
    }

    }

    就3个步骤,很简单

  • 相关阅读:
    微信小程序——Now you can provide attr "wx:key" for a "wx:for" to improve performance.
    mac 桌面美化
    获取json对象长度
    js 记忆函数
    js提取整数部分,移除首末空格
    js糟粕
    zepto 获取checked selected元素
    BFC块级排版上下文
    zepto 获取select选中的值
    手机不支持onchange事件
  • 原文地址:https://www.cnblogs.com/zhuwu/p/8832473.html
Copyright © 2020-2023  润新知