server {
listen ;
server_name paas.service.consul; client_max_body_size 512m;
access_log /data/bkdata/bkce/logs/nginx/paas_inner_access.log; # ============================ paas ============================
# PAAS_SERVICE HOST/PORT location ~ ^/login/(.*) {
proxy_pass http://OPEN_PAAS_LOGIN/$1$is_args$args;
proxy_pass_header Server;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_redirect off;
proxy_read_timeout ;
}
#user  root;
worker_processes auto; error_log /usr/local/var/log/nginx/error.log;
#pid logs/nginx.pid; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream;
#default_type text/html; client_max_body_size 2G;
server_names_hash_bucket_size ; sendfile on; keepalive_timeout ; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'"$gzip_ratio" $request_time $bytes_sent $request_length';
underscores_in_headers on;
include /usr/local/etc/nginx/conf.d/*.conf;
}

2.长连接需要配置

proxy_http_version 1.1;

proxy_set_header Connection "";  #如果没加,后端服务器会收到 Connection: close 的 Header,而不能复用连接; 清空connection的请求头,避免客户端传递短链接的请求头信息。

https://www.jianshu.com/p/fd16b3d10752

nginx - 反向代理 - 配置文件 header - 日志log格式的更多相关文章

  1. nginx.conf nginx反向代理配置文件

    nginx反向代理配置文件 nginx.conf proxy_default.conf proxy.conf vhost/*.conf upstream/*.conf cache/*.conf ngi ...

  2. nginx --反向代理配置文件

    配置文件如下图   server { listen 8080; server_name 0.0.0.0;//这里可以配置相应域名 root /www/facei; index index.html i ...

  3. Nginx反向代理时tomcat日志获取真实IP

    对于nginx+tomcat这种架构,如果后端tomcat配置保持默认,那么tomcat的访问日志里,记录的就是前端nginx的IP地址,而不是真实的访问IP.因此,需要对nginx.tomcat做如 ...

  4. Nginx反向代理配置文件

    server { listen ; server_name ; root E:/Upays/public/; index index.php index.html; log_not_found off ...

  5. Nginx反向代理设置header

    特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...

  6. nginx - 反向代理 - 配置文件模板 - nginx 代理tcp的服务 - 部署示意图

    danjan01deiMac:~ danjan01$ cat /usr/local/etc/nginx/nginx.conf|grep -v '^$' worker_processes 1; even ...

  7. 十.nginx反向代理负载均衡服务实践部署

    期中集群架构-第十章-nginx反向代理负载均衡章节章节====================================================================== 0 ...

  8. Nginx反向代理配置可跨域

    由于业务需要,同一项目中的前端代码放在静态环境中,而后端代码放在tomcat中,但此时问题却出现了:前端使用ajax请求后端获取数据时出现如下报错 XMLHttpRequest cannot load ...

  9. linux篇—Nginx反向代理负载均衡

    一.环境准备 反向代理功能架构 3台web服务器,组建出web服务器集群 web01 10.0.0.7 172.16.1.7 web02 10.0.0.8 172.16.1.8 web03 10.0. ...

随机推荐

  1. Axure RP 8 破解汉化(实测可用)

    Axure的安装教程初学乍练,从安装应用程序开始1.下载 下载地址:https://www.axure.com.cn/3510/ 2.破解:注册码(源于博主“前端大白兔”,原博客网址:http://b ...

  2. js拖拽文件夹上传

    由于项目需要上传文件到服务器,于是便在文件上传的基础上增加了拖拽上传.拖拽上传当然属于文件上传的一部分,只不过在文件上传的基础上增加了拖拽的界面,主要在于前台的交互, 从拖拽的文件中获取文件列表然后调 ...

  3. python3 基本数据类型转换

    '''基本数据类型1:虽然python中的变量不需要声明,但使用时必须赋值 1.整形变量 2.浮点型变量 3.字符型2:可以一个给多个变量赋值,也可以多个给多个变量赋值3:python3中有6个标准数 ...

  4. easyui编辑editor

    $.extend($.fn.datagrid.defaults.editors, { textarea: { init: function(container, options){ var input ...

  5. php phpexcel 读取excel文件数据

    public function readExcel(){ $allPath = '/home/examine\video/list.xls'; \think\Loader::import('exten ...

  6. LeetCode 88. 合并两个有序数组(Merge Sorted Array)

    题目描述 给定两个有序整数数组 nums1 和 nums2,将 nums2 合并到 nums1 中,使得 num1 成为一个有序数组. 说明: 初始化 nums1 和 nums2 的元素数量分别为 m ...

  7. bootstrap-table前端实现多条件时间段查询数据

    实现思路:通过正则匹配到字段是否符合条件,时间段转换为时间戳比对. 这是大体的效果图: 页面的html代码 <div class="content-head mgb10"&g ...

  8. redux异步

    在一个项目中 redux 是必不可少的,redux 中没有提供异步的操作,但是异步又是项目开发中重要的一部分,所以我们的 redux 对此有进行了拓展: 所以我们需要 redux-thunk 的插件, ...

  9. react 路由

    react 提供了实现路由的方式,不过需要我们下载插件 react-router-dom 当我们下载好了插件,然后我们可以通过 import {} from 'react-router-dom' 来引 ...

  10. java_切面日志

    切面日志举例 package com.keyba1; import java.lang.annotation.ElementType; import java.lang.annotation.Rete ...