upstream.conf

upstream api {

server 192.168.10.10:8080;
server 192.168.10.20:8080;
}

server{
listen 443 ssl;
server_name gui.sensen.com;

location / {
proxy_pass http://api;
proxy_redirect off;
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;
}
access_log /var/log/nginx/sensen/acccess.log json;

}

rewrite.conf

server{
listen 443 ssl;
server_name doc.luoluo.com;

location / {
proxy_pass http://192.168.10.10:8080;
proxy_redirect off;
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;
rewrite ^/(.*)$ /api/$1 break;
}

location /api {
proxy_pass http://192.168.10.20:8080;
proxy_redirect off;
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;
}
access_log /var/log/nginx/sensen/doc_acccess.log main;
}

producter.conf

server{
listen 443 ssl;
server_name producter.luoluo.com;

location / {
proxy_pass http://192.168.10.10:9091;
proxy_redirect off;
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_set_header Cookie $http_cookie;
}

location /pay {
proxy_pass http://192.168.10.20:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
rewrite ^/pay/(.*)$ /rest/payment/$1 break;
}

location /rest/service/ {
proxy_pass http://192.168.10.30:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
access_log /var/log/nginx/producter/access.log json;

}

normal.conf

server{
listen 443 ssl;
server_name sn.luluo.com;

location / {
proxy_pass http://192.168.10.20:80;
proxy_redirect off;
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_set_header Cookie $http_cookie;
}
access_log /var/log/nginx/sensen/access.log json;

}

nginx proxy文件编写总结的更多相关文章

  1. Nginx优化文件编写

    server_tokens off; #并不会让nginx执行的速度更快,关闭它可隐藏错误页面中的nginx版本号charset utf-8,gbk; #字符#sendfile on;#tcp_nop ...

  2. nginx proxy大文件上传失败问题总结

    问题描述: http://www.syhuo.net ota.apk包上传正常 http://www.syhuo.net:8080 ota.apk包上传不正常 查看nginx error日志 [roo ...

  3. nginx自定义模块编写-实时统计模块--转载

    原文:http://www.vimer.cn/2012/05/nginx%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A8%A1%E5%9D%97%E7%BC%96%E5%86%99- ...

  4. nginx自定义模块编写-根据post参数路由到不同服务器

    nginx可以轻松实现根据不同的url 或者 get参数来转发到不同的服务器,然而当我们需要根据http包体来进行请求路由时,nginx默认的配置规则就捉襟见肘了,但是没关系,nginx提供了强大的自 ...

  5. nginx编译文件配置(原)

    1.在根目录的opt下创建文件夹software并wget一个nginx包进行解压,/opt/software/,解压后需要对软件包文件进行授权 2.cd到nginx目录输入id nginx 未安装插 ...

  6. Nginx+proxy实现简单的负载均衡

    环境说明:操作系统centos6.6 64位web操纵系统是:web1=192.168.10.10(LAMP) web2=192.168.10.11(LNMP),这里只是测试nginx实现负载均衡效果 ...

  7. Keepalivaed +Nginx proxy 高可用架构方案与实施过程细节

    1.开源产品介绍 1)CMS介绍 官方网站http://www.dedecms.com/,是一个网站应用系统构建平台,也是一个强大的网站内容管理系统,既可以用来构建复杂的体系的企业信息门户或者电子商务 ...

  8. nginx实现文件上传和下载

    nginx实现文件上传和下载 发布时间:2020-06-05 16:45:27 来源:亿速云 阅读:156 作者:Leah 栏目:系统运维 这篇文章给大家分享的是nginx实现文件上传和下载的方法.小 ...

  9. Docker Nginx-Proxy 容器Nginx Proxy反向代理

    Docker Nginx-Proxy 容器Nginx Proxy反向代理   简单介绍 Docker容器的自动Nginx反向代理   dockerhub地址 https://hub.docker.co ...

随机推荐

  1. 安装使用swoole

    swoole首页:https://www.swoole.com/ 方法1:使用pecl安装 pecl install swoole 注意,php版本必须是7.0以及7.0以上的版本. 方法2:编译源码 ...

  2. pip ipython启动错误 Fatal error in launcher: Unable to create process using

    完整的错误提示: C:\Users\yyy>ipython3Fatal error in launcher: Unable to create process using '"c:\u ...

  3. 三、taro路由及设计稿及尺寸单位

    一.路由配置 路由配置跟小程序一样,在入口文件的 config 配置中指定好 pages 通过taro API 跳转,详见导航 // 跳转到目的页面,打开新页面 Taro.navigateTo({ u ...

  4. ssh登录

    ssh 用户名@IP地址 -p 端口号 ssh root@127.0.0.1 -p 2222

  5. MySQL 日期类型函数及使用

    1 MySQL 数据库中有五种与日期时间有关的数据类型,各种日期数据类型所占空间如下图所示: 2 datetime 与 date datetime 占用8字节,是占用空间最多的一种日期格式.它显示日期 ...

  6. redis的配置文件解释

    redis的守护进行 守护进程(Daemon Process),也就是通常说的 Daemon 进程(精灵进程),是 Linux 中的后台服务进程.它是一个生存期较长的进程,通常独立 于控制终端并且周期 ...

  7. 【转】Java基础——容器分类

    Java容器可以说是增强程序员编程能力的基本工具,本系列将带您深入理解容器类. 容器的用途 如果对象的数量与生命周期都是固定的,自然我们也就不需要很复杂的数据结构. 我们可以通过创建引用来持有对象,如 ...

  8. java学习之—链表(4)

    /** * 使用链表实现队列 * Create by Administrator * 2018/6/19 0019 * 下午 4:37 **/ public class Link { public l ...

  9. centos6.8 安装wget

    1.执行yum -y install wget 提示:没有相应的包.原因:默认最小化安装没有装wget,而且默认源中没有wget,所以只能先切换源配置. (1)下载.阿里的源配置,并放到/etc/yu ...

  10. react 粗略使用

    1.首先在index.html页面上写好dom,给他一个id让他引用js里的react. 2.index.js里面的代码就是三步走. 第一步:引用react,各种引用依赖. 第二步:创建dom,但它是 ...