nginx - 反向代理 - 配置文件 header - 日志log格式
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格式的更多相关文章
- nginx.conf nginx反向代理配置文件
nginx反向代理配置文件 nginx.conf proxy_default.conf proxy.conf vhost/*.conf upstream/*.conf cache/*.conf ngi ...
- nginx --反向代理配置文件
配置文件如下图 server { listen 8080; server_name 0.0.0.0;//这里可以配置相应域名 root /www/facei; index index.html i ...
- Nginx反向代理时tomcat日志获取真实IP
对于nginx+tomcat这种架构,如果后端tomcat配置保持默认,那么tomcat的访问日志里,记录的就是前端nginx的IP地址,而不是真实的访问IP.因此,需要对nginx.tomcat做如 ...
- Nginx反向代理配置文件
server { listen ; server_name ; root E:/Upays/public/; index index.php index.html; log_not_found off ...
- Nginx反向代理设置header
特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...
- nginx - 反向代理 - 配置文件模板 - nginx 代理tcp的服务 - 部署示意图
danjan01deiMac:~ danjan01$ cat /usr/local/etc/nginx/nginx.conf|grep -v '^$' worker_processes 1; even ...
- 十.nginx反向代理负载均衡服务实践部署
期中集群架构-第十章-nginx反向代理负载均衡章节章节====================================================================== 0 ...
- Nginx反向代理配置可跨域
由于业务需要,同一项目中的前端代码放在静态环境中,而后端代码放在tomcat中,但此时问题却出现了:前端使用ajax请求后端获取数据时出现如下报错 XMLHttpRequest cannot load ...
- 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. ...
随机推荐
- Mybatis Generator-自动化生成代码步骤
链接:https://blog.csdn.net/guo_xl/article/details/86004068 文档:http://mybatis.org/generator/configrefer ...
- 关于redis的主从、哨兵、集群(转)
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/c295477887/article/de ...
- Visual Studio 编译Winform程序不生成.vshost.exe和.pdb文件的方法
问题:使用Visual Studio编译工程时,默认设置下,即使选择了「Release」时也会生成扩展名为「.vshost.exe」和「.pdb」的文件. 先解释一下各个文件的作用: .pdb文件: ...
- 《剑指offer》算法题第十二天
今天是<剑指offer>算法题系列的最后一天了,但是这个系列并没有包括书上的所有题目,因为正如第一天所说,这些代码是在牛客网上写并且测试的,但是牛客网上并没有涵盖书上所有的题目. 今日题目 ...
- python学习用到的网站
官方地址:https://www.python.org/ 玩蛇网:http://www.iplaypython.com/
- python拼音库pypinyin库详解
# -*- coding: utf-8 -*- # @Author : FELIX # @Date : 2018/6/30 9:20 from pypinyin import pinyin, lazy ...
- delphi中Tkbmmemtable数据转成SQL脚本
unit UMemtableToSql; interface uses SysUtils, Classes, DB, kbmMemTable, Variants, Dialogs, SuperObje ...
- jQuery文档操作之克隆操作
语法: $(selector).clone(); 解释:克隆匹配的DOM元素 $("button").click(function(event) { //1.clone():克隆匹 ...
- Java线程之如何分析死锁及避免死锁
什么是死锁 java中的死锁是一种编程情况,其中两个或多个线程被永久阻塞,Java死锁情况出现至少两个线程和两个或更多资源. 在这里,我们将写了一个简单的程序,它将导致java死锁场景,然后我们将分析 ...
- python-matplotlib-2
figure的使用 x = np.linspace(-1, 1, 50) y1 = 2 * x + 1 #figure 1 plt.figure() plt.plot(x, y1) # figure ...