#user  nginx;
worker_processes ; #error_log /var/log/nginx/error.log warn;
#pid /var/run/nginx.pid; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; #gzip on; upstream Jq_one{
#server 192.168.11.175:;
#server 192.168.11.192:;
server zh.hainan.gov.cn;
#server 10.34.1.31;
} server {
listen ;
server_name 10.34.1.21; #charset koi8-r; #access_log logs/host.access.log main; #location / {
# root html;
# index index.html index.htm;
#}
#my own location
location / {
proxy_pass http://Jq_one;
#proxy_pass http://localhost;
#proxy_redirect / /ahyc/Web_Water/;
#proxy_redirect default;
root html;
index index.aspx index.html index.htm; #修改主页为index.aspx
#其中jq_one 对应着upstream设置的集群名称 #设置主机头和客户端真实地址,以便服务器获取客户端真实IP
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }} #第二个port app test;
upstream ahwater_portal{
server 10.34.1.31;
}
server {
listen ;
server_name 10.34.1.21;
location / {
proxy_pass http://ahwater_portal;
root html;
index index.aspx index.html index.htm; #修改主页为index.aspx
#其中jq_one 对应着upstream设置的集群名称 #设置主机头和客户端真实地址,以便服务器获取客户端真实IP
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }}
#第二个port app test;
upstream ahwater_portal2{
server 10.2.1.221;
}
server {
listen ;
server_name 10.34.1.21;
location /{
proxy_pass http://ahwater_portal2;
root html;
index index.aspx index.html index.htm; #修改主页为index.aspx #其中jq_one 对应着upstream设置的集群名称 #设置主机头和客户端真实地址,以便服务器获取客户端真实IP
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } }

nginx 代理http配置实例的更多相关文章

  1. Nginx反向代理websocket配置实例

    最近有一个需求,就是需要使用 nginx 反向代理 websocket,经过查找一番资料,目前已经测试通过,本文只做一个记录 复制代码 代码如下: 注: 看官方文档说 Nginx 在 1.3 以后的版 ...

  2. Nginx 线上配置实例

    1 /etc/nginx/nginx.conf,在主配置下设置 /etc/nginx/conf.d/*.conf user nginx;worker_processes 1; error_log /v ...

  3. nginx代理路径配置总结

    一.发现问题 配置nginx代理的时候,发现location配置的路径和代理的上下文路径的组合不同,服务端接收到的uri的路径不同,导致了controller的RequestMapping匹配出现问题 ...

  4. 单机部署minio,设置Nginx代理,配置https(TLS)访问

    安装 下载地址:https://dl.min.io/ # 创建目录 mkdir -p /usr/local/minio/{data,bin,etc} # 下载minio wget https://dl ...

  5. Nginx负载均衡配置实例

    面对高并发的问题,企业往往会从两个方面来解决.其一,从硬件上面,提升硬件的配置,增加服务器的性能:另外,就是从软件上,将数据库和WEB服务器分离,使数据库和WEB服务器都能够充分发挥各自的性能,并且二 ...

  6. Nginx负载均衡与反向代理的配置实例

    user www www; worker_processes 10; error_log /data1/logs/nginx_error.log crit; pid /usr/local/webser ...

  7. Nginx反向代理websocket配置实例(官网)

    https://www.nginx.com/blog/websocket-nginx/ Blog Tech Rick Nelson of NGINX, Inc.   May 16, 2014   NG ...

  8. Nginx负载均衡配置实例详解

    负载均衡是我们大流量网站要做的一个东西,下面我来给大家介绍在Nginx服务器上进行负载均衡配置方法,希望对有需要的同学有所帮助哦. 负载均衡 先来简单了解一下什么是负载均衡,单从字面上的意思来理解就可 ...

  9. Nginx负载均衡配置实例详解(转)

    负载均衡是我们大流量网站要做的一个东西,下面我来给大家介绍在Nginx服务器上进行负载均衡配置方法,希望对有需要的同学有所帮助哦. 负载均衡 先来简单了解一下什么是负载均衡,单从字面上的意思来理解就可 ...

随机推荐

  1. [Python] RuntimeError: Invalid DISPLAY variable

    1.问题:在本地用matplotlib绘图可以,但是在ssh远程绘图的时候会报错 RuntimeError: Invalid DISPLAY variable 2.原因:matplotlib的默认ba ...

  2. 理解 XCode 中的 Git 版本控制

    连接地址:http://www.oschina.net/translate/git-source-control-in-xcode?cmp&p=1#

  3. linux下升级svn版本到1.8

    CentOS6.5默认yum安装的svn版本为1.6,有时候遇到比较高级的应用就可能不够使用,这时候就需要升级一下svn的版本,可以升级到的版本为1.8 ====== 完美的分割线 ====== 1. ...

  4. Linux shell multifile content replace with sed

    #!/bin/bash # Linux shell multifile content replace with sed # 声明: # 本源代码主要是利用两份(中.英文)具有相同键值对的json数据 ...

  5. Markdown 效果测试

    欢迎使用 Cmd - 在线 Markdown 编辑阅读器 \[ \int e^{-x^2 - y^2} dx = \sqrt{2 \pi} \] 我们理解您需要更便捷更高效的工具记录思想,整理笔记.知 ...

  6. 线性回归 Linear regression(4) 局部加权回归

    这篇文章将介绍过拟合和欠拟合的概念,并且介绍局部加权回归算法. 过拟合和欠拟合 之前在线性回归中,我们总是将单独的x作为我们的特征,但其实我们可以考虑将,甚至x的更高次作为我们的特征,那么我们通过线性 ...

  7. maven报错【Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of】

    [自己的操作] (1)windows -> Preferences -> maven 的settings.xml文件中.m2的位置已经失效,更改正确后尝试 (2)pom.xml还有下面错误 ...

  8. svg图片的缩放拖拽

    svg是一种不错的矢量图,有时候我们会使用这样的图片来作为展示图,因为它不会因为放大缩小而失真. 好了,不扯淡了,废话少说,直入主题吧. 首先确定你是要深入学习还是要简单的把遇到的小任务解决一下,以后 ...

  9. 服务器上通过FTP共享文件夹

    近日,公司某服务器共同操作的人员增多,而我只需访问及替换某些文件,故想到共享文件夹. 在IIS中建立ftp站点,添加虚拟目录(可多个,对应不同文件夹),设置允许访问的用户(添加用户,见在IIS上搭建F ...

  10. notepad++运行paython程序

    cmd /k C:\Python30\python.exe "$(FULL_CURRENT_PATH)" & PAUSE & EXIT 添加引用的环境变量