zoukankan      html  css  js  c++  java
  • 微服务框架搭建-问题汇总-跨域

    1,问题:在A系统中访问B系统时跨域问题(Blocked a frame with origin "http://192.168.11.3:8084" from accessing a cross-origin frame.)

    解决:通过nginx解决跨域问题

    (1)关键配置信息

    (2)完整nginx.conf

    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        sendfile        on;
        keepalive_timeout  65;
    
        server {
            listen       80;
            server_name  localhost;
    
            location / {
                root   html;
                index  index.html index.htm;
                add_header 'Access-Control-Allow-Origin' '*';
            }
            
            location /xmkkj {
                include  uwsgi_params;
                proxy_pass   http://192.168.11.3:8082;
           }
           
            location /xmkj {
                include  uwsgi_params;
                proxy_pass   http://192.168.11.3:8084;
           }
            
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
        }
    
    
    }

    配置前访问路径:
    http://192.168.11.3:8084/xmkj/webView/jcxx/xtxx/xtxx_list.jsp
    配置后访问路径:
    http://192.168.11.3/xmk/webView/jcxx/xtxx/xtxx_list.jsp


    配置前访问路径:
    http://192.168.11.3:8082/xmkkj/webView/jcxx/xtxx/xtxx_list.jsp
    配置后访问路径:
    http://192.168.11.3/xmkkj/webView/jcxx/xtxx/xtxx_list.jsp

  • 相关阅读:
    hdu 3268 09 宁波 现场 I
    hdu 3697 10 福州 现场 H
    CodeForces Round #521 (Div.3) D. Cutting Out
    #Leetcode# 226. Invert Binary Tree
    zufe 蓝桥选拔
    #Leetcode# 100. Same Tree
    #Leetcode# 6. ZigZag Conversion
    PAT 1084 外观数列
    #Leetcode# 38. Count and Say
    #Leetcode# 22. Generate Parentheses
  • 原文地址:https://www.cnblogs.com/excellencesy/p/11934767.html
Copyright © 2011-2022 走看看