nginx填坑补充(nginx根据上下文跳转ip或者域名)
今天有一个需求,要根据上下文调到不同的ip或域名地址,使用上下文做域名跳转的时候,proxy_pass域名后面一定要带‘/’否则会把nginx的上下文自动带入,这样就行。
location ^~ /docs/ {
root html;
add_header Cache-Control no-store;
add_header 'Access-Control-Allow-Origin' '*';
index index.html index.htm;
proxy_pass http://47.92.128.109:8080/;
}
location / {
root html;
add_header Cache-Control no-store;
add_header 'Access-Control-Allow-Origin' '*';
index index.html index.htm;
proxy_pass http://cg.haier.net;
}
nginx填坑补充(nginx根据上下文跳转ip或者域名)的更多相关文章
- 填坑!!!virtualenv 中 nginx + uwsgi 部署 django
一.为什么会有这篇文章 第一次接触 uwsgi 和 nginx ,这个环境搭建,踩了太多坑,现在记录下来,让后来者少走弯路. 本来在 Ubuntu14.04 上 搭建好了环境,然后到 centos7. ...
- Nginx之负载均衡 :两台服务器均衡(填坑)
第一步,两台服务器都要安装好Nginx和Tomcat,我这边的安装的是Nginx 1.16.1 Tomcat9: 第二步,安装完成之后,选择你要做均衡的那台服务器,,打开其Nginx 配置文件,在se ...
- 为什么nginx error_page遇到后端错误时不跳转?
nginx不得不说的参数之 proxy_intercept_errors与fastcgi_intercept_errors 为什么我的error_page 配置没有生效,没有正常跳转?我也遇到过这个问 ...
- nginx error_page 404 用 php header 无法跳转
nginx error_page 404 用 php header 无法跳转 之前用Apache的时候,只需要设置 ErrorDocument 404 /404.php 就可以在 404.php 中根 ...
- nginx二级域名配置自动跳转到一级域名
nginx二级域名配置自动跳转到一级域名 rewrite配置内容: if ($http_host !~ "^www.aaa.com$") { rewrite ^(.*) http: ...
- 用rewrite把旧域名直接跳转到新域名的nginx配置
用rewrite把旧域名直接跳转到新域名的nginx配置 把下面代码保存到daziran.com.conf 放在nginx配置目录下 /etc/nginx/conf.d/ #把旧域名zdz8207直接 ...
- nginx做http向https的自动跳转
在访问百度时,在浏览器输入www.baidu.com会自动跳转到https://www.baidu.com不用人工干预,nginx也可以做这样的自动跳转! 首先让nginx服务器监听两个端口,分别是8 ...
- 【虚拟机-网关】如何在使用应用程序网关和 Nginx 的环境下实现强制 HTTPS 跳转
背景介绍 大家在使用 Nginx 部署网站时,实现 HTTP 到 HTTPS 的强制跳转是非常容易的事情,一般可以使用rewrite 命令或者使用返回自定义 301 页面的方法对 HTTP 请求进行 ...
- mac无坑安装nginx
mac无坑安装nginx 首先需要mac下有一个缺失的软件包的管理器------->homebrew 1.打开终端输入 brew update 说明homebrew已经安装好了 2.继续执行以下 ...
随机推荐
- dp的刷表法和填表法
dp的刷表法和填表法 参考: 动态规划刷表法 - acmer_xue的博客 - CSDN博客http://blog.csdn.net/qq_30241305/article/details/52198 ...
- PIL库,图像处理第三方库
PIL ---> python imaging library 安装需要安装pillow库,包含了21种类,其中Image类是PIL最重要的一个类,可以通过它来处理图像. Python最常用的 ...
- ios 最全的常用字符串操作
1.将NSData / NSString转化 1 2 3 NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding]; // 将字符串 ...
- 未来-YLB-跳蚤市场:跳蚤市场(flea market)
ylbtech-未来-YLB-跳蚤市场:跳蚤市场(flea market) 跳蚤市场(flea market)是欧美等西方国家对旧货地摊市场的别称.由一个个地摊摊位组成,市场规模大小不等. 出售商品多 ...
- JWT工具类
package com.ynhrm.common.utils; import io.jsonwebtoken.Claims;import io.jsonwebtoken.JwtBuilder;impo ...
- Tomcat启动脚本(1)startup.bat
@echo off rem Licensed to the Apache Software Foundation (ASF) under one or more rem contributor lic ...
- @Validated和@Valid区别:Spring validation验证框架对入参实体进行嵌套验证必须在相应属性(字段)加上@Valid而不是@Validated
Spring Validation验证框架对参数的验证机制提供了@Validated(Spring's JSR-303规范,是标准JSR-303的一个变种),javax提供了@Valid(标准JSR- ...
- C# dynamic类型序列化和反序列化之Newtonsoft.Json
原文:C# dynamic类型序列化和反序列化之Newtonsoft.Json 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u011127019/ ...
- LeetCode Array Easy 66. Plus One
Description Given a non-empty array of digits representing a non-negative integer, plus one to the i ...
- 创建win32 dll 空项目
动态库,多字节 win32 空项目 添加导出头文件 类 导入: #pragma once #ifndef IP_CLASS_DLL_H #define IP_CLASS_DLL_H #pragma ...