zoukankan      html  css  js  c++  java
  • nginx 跨域解决

    server {

      listen 8811 default_server;

     

       root /opt/bp;

     

       # Make site accessible from http://localhost/

       server_name localhost;

     

       location / {

         if ( $request_method = OPTIONS ) { add_header Access-Control-Allow-Origin "$http_origin";add_header Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, DELETE";add_header Access-Control-Max-Age "3600";add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization";add_header Access-Control-Allow-Credentials "true";add_header Content-Length 0;add_header Content-Type text/plain;return 200;} add_header 'Access-Control-Allow-Origin' '$http_origin';add_header 'Access-Control-Allow-Credentials' 'true';add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, OPTIONS';add_header 'Access-Control-Allow-Headers' 'Content-Type,*';try_files $uri $uri/ =404;autoindex on;}

    }

  • 相关阅读:
    HDU3910(数学期望题,题目难懂)
    HDU2389(二分图匹配Hopcroft-Carp算法)
    二分图详解
    巴什博弈、威佐夫博弈、尼姆博弈
    HDU2819(二分图匹配,记录过程)
    查找外键未创建索引
    acl使用示例
    oracle数据库备份任务
    集中备份相关
    集中备份项目实施方案
  • 原文地址:https://www.cnblogs.com/sea-stream/p/9457014.html
Copyright © 2011-2022 走看看