• nginx跨域


    location /common-service {
    proxy_pass http://172.19.183.152:8600/proxy/common-service;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout 4;
    proxy_send_timeout 1200;
    proxy_read_timeout 1200;
    if ($request_method = 'OPTIONS') {
    add_header 'Access-Control-Allow-Origin' '*' always;
    add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE' always;
    add_header 'Access-Control-Allow-Headers' '*' always;
    add_header 'Access-Control-Max-Age' 1728000 always;
    add_header 'Content-Length' 0;
    add_header 'Content-Type' 'text/plain; charset=utf-8';
    return 204;
    }

    }

  • 相关阅读:
    jqGrid表格控件的学习
    list 集合筛选数据
    MySQL跨域
    11-Index页面
    11-Comment页面
    11-Add页面
    11-UploadFile
    11-控制器UI
    11-控制器
    11-数据访问层
  • 原文地址:https://www.cnblogs.com/ruiy/p/15124678.html
Copyright © 2020-2023  润新知