zoukankan      html  css  js  c++  java
  • NGINX头

    location / {
       
       #处理浏览器OPTIONS 预请求,默认返回200
       if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Allow-Credentials' true;
        add_header 'Access-Control-Allow-Origin' "$http_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,Content-Range,Range';
        add_header 'Access-Control-Max-Age' 1728000;
        add_header 'Content-Type' 'application/json; charset=utf-8';
        add_header 'Content-Length' 0;
        return 200;
       }
       
       proxy_pass http://tomcat ;
       #tomcat支持https 请求,须tomcat 更改相关配置
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
       proxy_set_header Host $http_host; 
       proxy_set_header X-Forwarded-Proto https; 
       proxy_redirect off; 
      
      
            }



  • 相关阅读:
    【UNR#3】白鸽
    【POI2011】Garbage
    【NOI2010】海拔
    【HNOI2012】矿场搭建
    【UOJ#177】欧拉回路
    【BZOJ4500】矩阵
    【CF429E】Points and Segments
    【agc001F】Wide Swap
    【BZOJ2138】stone
    【JSOI2009】游戏
  • 原文地址:https://www.cnblogs.com/leigepython/p/12235655.html
Copyright © 2011-2022 走看看