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

 

posted on 2019-11-26 13:02  song.yan  阅读(415)  评论(0编辑  收藏  举报