• 代理_nginx_proxy


    192.168.3.222   nginx+php  略

    192.168.3.22     mariadb      略   

    192.168.3.21          proxy_nginx  

    21host:安装nginx

    [root@localhost conf.d]# cat /etc/nginx/proxy_params
    proxy_set_header Host $http_host;              //把域名也传到nginx
    proxy_set_header X-Real-IP $remote_addr;        //把客户端IP通过变量存放并传到nginx
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;//让nginx后端记录客户端真实地址

    proxy_connect_timeout 30;      //代理向后端链接超时时间
    proxy_send_timeout 60;        //代理等待后端响应时间
    proxy_read_timeout 60;      //后端代理回传超时时间

    proxy_buffering on;        //代理把数据放缓冲区,on(默认)
    proxy_buffer_size 32k;        //代理保存用户头信息缓冲区大小
    proxy_buffers 4 128k;       //缓冲区

    ---------------------------------------------------------------------------------------------------------

    [root@localhost conf.d]# vim default.conf
    server {
    listen 80;
    server_name www.le.com;
    location / {
    proxy_pass http://192.168.3.222:80;
    include proxy_params;
    }
    }

    -------------------------------------------------------------------------------------------------------

    nginx -t

    systemctl restart nginx

    [root@localhost conf.d]# cat /etc/nginx/proxy_params proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout 30;proxy_send_timeout 60;proxy_read_timeout 60;
    proxy_buffering on;proxy_buffer_size 32k;proxy_buffers 4 128k;'

    nginx log:

    开启模块

    192.168.3.21 - - [2020-03-15T21:10:49+08:00] "GET / HTTP/1.0" 200 43745 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36" "192.168.3.9"
    关闭模块
    192.168.3.21 - - [2020-03-15T21:11:23+08:00] "GET / HTTP/1.0" 200 43748 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36" "-"

  • 相关阅读:
    Android 数据库框架 DBFlow 的使用
    Android进阶AIDL使用自定义类型
    Android进阶之AIDL的使用详解
    RecyclerView实现拖动排序和滑动删除功能
    RecyclerView的刷新分页
    RecyclerView 的 Item 的单击事件
    RecyclerView 的简单使用
    AutoCompleteTextView的简单使用
    Spinner的简单实用
    黎曼猜想
  • 原文地址:https://www.cnblogs.com/Leaders543/p/12499620.html
Copyright © 2020-2023  润新知