nginx基于目录的映射:

   location /wxchat/ {
#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_cookie_path /xie_wechat /wechat;
proxy_set_header Cookie $http_cookie; proxy_pass http://10.8.0.9:8080/xie_wechat/;
#proxy_set_header X-Forwarded-Proto https;
proxy_redirect http:// $scheme://; #try_files $uri $uri/ /index.html; if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
} if ($request_filename ~* .*.(html|htm)$)
{
expires -1s;
}
if ($request_filename ~* .*.(gif|jpg|jpeg|png|bmp|swf)$)
{
expires -1s;
}
if ($request_filename ~ .*.(js|css)$)
{
expires -1s;
}
}

  

nginx基于目录的映射:的更多相关文章

  1. Nginx安装目录详解

    Nginx安装目录详解 1. 查看有关nginx的所有目录列表,输入命令  rpm -ql nginx 可以查看有关nginx目录信息,但是注意 这种命令只能是在基于yum安装的方式才可以. 2. 下 ...

  2. Linux下查看Nginx安装目录、版本号信息?

    Linux环境下,怎么确定Nginx是以那个config文件启动的? 输入命令行: ps  -ef | grep nginx 摁回车,将出现如下图片: master process 后面的就是 ngi ...

  3. Nginx基于TCP/UDP端口的四层负载均衡(stream模块)配置梳理

    通过我们会用Nginx的upstream做基于http/https端口的7层负载均衡,由于Nginx老版本不支持tcp协议,所以基于tcp/udp端口的四层负载均衡一般用LVS或Haproxy来做.至 ...

  4. nginx配置目录列表访问权限

    我们知道apache httpd默认情况下会显示访问目录的文件列表,但是nginx访问时如果目录下面没有默认首页,那么会返回403 Forbidden的错误,表示没有权限访问,比如根目录就是nginx ...

  5. 二、nginx 安装目录详解

    rpm -ql nginx 路径 类型 介绍 /etc/logrotate.d/nginx  配置文件  Nginx 日志轮转,用于logrotate服务日志切割 /etc/nginx /etc/ng ...

  6. nginx 安装目录详解

    rpm -ql nginx 路径 类型 介绍 /etc/logrotate.d/nginx  配置文件  Nginx 日志轮转,用于logrotate服务日志切割 /etc/nginx /etc/ng ...

  7. nginx安装目录

    1.rpm -ql nginx看看通过yum安装到哪里了 2./etc/logrotate.d/nginx    配置 nginx日志轮转 用于logrotate服务的日志切割 3./etc/ngin ...

  8. Nginx 安装目录 和 编译参数

    安装目录详解 查看安装nginx之后总共生成了哪些文件 rpm -ql nginx 在上面的文件中包括配置文件和日志文件 /etc/logrotate.d/nginx 类型:配置文件 作用:Nginx ...

  9. Nginx安装目录讲解

    查看nginx相关目录 rpm -ql nginx 查看到如下目录 /etc/logrotate.d/nginx 配置文件 作用:nginx日志轮转,用于logrotate(轮替)服务的日志切割 /e ...

随机推荐

  1. wx小程序用canvas生成图片流程与注意事项

    1.需要画入canvas的 图片都需要先缓存到本地 let ps = [] ps.push(that.loadImageFun(this.statusInfo.avatar_url, "he ...

  2. Arrays.copyOfRange()

    Comparable[] aux = Arrays.copyOfRange(arr,from, to); 复制数组arr, from下标开始, to下标结束. 但是不包括to. 所以复制代码为 Com ...

  3. css3渐变 两边透明中间高亮

    颜色自己可以调节 如图: 采集器管理下面的那条线就是 css代码: .linear{            width:100%;            height:2px;            ...

  4. 获取Map的key和value的两种方法

    //使用迭代器,获取key; /*Iterator<String> iter = map.keySet().iterator(); while(iter.hasNext()){ Strin ...

  5. rtsp 学习之路一

    http://baijiahao.baidu.com/s?id=1587715130853990653&wfr=spider&for=pc https://www.cnblogs.co ...

  6. CFG文件格式

    大多数情况下,很多程序都要保存用户的设置,办法有很多:注册表,日志文件·..... 而很多程序都使用了一个专用的文件.为了方便起见,常常命名为*.cfg,有时甚至直接命名为Config.cfg. 这只 ...

  7. leetcode 772.Basic Calculator III

    这道题就可以结合Basic Calculator中的两种做法了,分别是括号运算和四则运算的,则使用stack作为保持的结果,而使用递归来处理括号内的值的. class Solution { publi ...

  8. webpack的一些详细配置

    http://blog.csdn.net/c_kite/article/details/71279853

  9. 牛客国庆集训派对Day1 L-New Game!(最短路)

    链接:https://www.nowcoder.com/acm/contest/201/L 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 1048576K,其他语言20 ...

  10. 莫队算法 [国家集训队]小Z的袜子

    题目链接   洛古   https://www.luogu.org/problemnew/show/P1494 大概说下自己的理解 先来概率的计算公式   ∑C(2,f(i))  /  C(2,r−l ...