location / project ??? {???? ?? ????? proxy_pass http://localhost:8081/project;? ? ? ? ?proxy_set_header Host $host:$server_port; ??????? proxy_set_header X-Real-IP $remo...
分类:
其他好文 时间:
2015-08-13 20:37:12
阅读次数:
162
proxy_set_headerHOST$host这个参数的赋值,在做转发的时候非常重要,他直接可以决定server_name匹配值,下面我们看一个例子:先说一下测试架构:nginx1(10.0.0.8)->nginx2(10.0.0.1)->tomcat(10.0.0.100)一、各节点配置信息1、还需要一台测试机,测试机上需要首先配置ho..
分类:
其他好文 时间:
2015-07-24 00:05:28
阅读次数:
437
#虽然都是location但是是有区别的#设置首页location = / { proxy_pass http://127.0.0.1/site/eshop/home.html; proxy_set_header Host $host; proxy_set_heade...
分类:
Web程序 时间:
2015-06-29 19:24:38
阅读次数:
172
今天同事遇到一个问题,我之前也遇到过。。在nginx配置中,很多站喜欢加上$_SERVER自定义变量proxy_set_headerSITE_NAME‘abc.com‘在PHP中$_SERVER始终读取不到http_site_name。有的配置缺可以。。各种搜索引擎未果,underscores_in_headerson设置无效。在个别版本中proxy_set_he..
分类:
其他好文 时间:
2015-04-22 02:13:09
阅读次数:
482
[root@localhost domains]# vi web.jd.com location / proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; upstream t...
分类:
其他好文 时间:
2015-04-16 19:40:36
阅读次数:
155
当负载端口不是80时,发现所有 response.sendRedirect() 重定向的页面都返回80端口,后来发现是代理设置Header时没有指定Ngnix监听的负载端口 #设置被代理服务器的端口或套接字,以及URL proxy_set_header Host $...
分类:
其他好文 时间:
2015-04-10 20:35:53
阅读次数:
157
我的nginx服务器在香港,直接在nginx配置文件中添加一下内容就可以proxy_cache_pathconf/cache/onelevels=1:2keys_zone=one:10mmax_size=10g;
proxy_cache_key"$host$request_uri";
server{
listen80;
server_nameg.example.com;
access_log/var/log/nginx/access.log;
rewrite..
分类:
其他好文 时间:
2014-12-02 00:23:37
阅读次数:
157
通过查资料后,再去看了看我的配置文件,结果发现我没有如下配置: nginx反向代理配置时,一般会添加下面的配置: ????? proxy_set_header Host $host; ??????proxy_set_header X-Real-IP $remote_ad...
分类:
其他好文 时间:
2014-11-21 00:10:23
阅读次数:
174
Nginx默认反向后的端口为80,因此存在被代理后的端口为80的问题,这就导致访问出错。主要原因在Nginx的配置文件的host配置时没有设置响应的端口。相关配置文件如下:proxy_pass http://ime-server/ime-server;proxy_set_header Host $h...
分类:
其他好文 时间:
2014-10-28 15:02:37
阅读次数:
190
nginx做反向代理显示在后台访问的真实ip总是显示127.0.0.1只要添加如下内容:proxy_set_header Host $host;proxy_set_header X-Forwarded-For $remote_addr;如果你是java环境做个检测jsp文件访问192.168.0.2...
分类:
其他好文 时间:
2014-10-27 22:57:57
阅读次数:
251