• nginx跨域


       location /usercenter-service {
                            more_clear_headers "Access-Control-Allow-Origin";
                            more_clear_headers "Access-Control-Allow-Methods";
                            more_clear_headers "Access-Control-Allow-Headers";
                            add_header Access-Control-Allow-Origin *;
                            add_header Access-Control-Allow-Methods 'GET, POST, PUT,DELETE';
                            add_header Access-Control-Allow-Headers 'Origin, X-Requested-With, Content-Type, Accept';

                            if ($request_method = 'OPTIONS') {
                                    return 204;
                            }
                proxy_pass http://172.19.39.146:9055/usercenter-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;

         }

  • 相关阅读:
    Linux下tomcat中多项目配置druid报错的问题
    chrome实用快捷键速记
    count 与 group by
    H5相机上传图片压缩
    图片通过转base64上传
    内网之间访问
    composer 加载第三方类库
    访问一个项目生成两个session文件原因
    arttemplate.js 如何不直接输出html代码
    Tomcat 支持多少并发量
  • 原文地址:https://www.cnblogs.com/ruiy/p/15162443.html
Copyright © 2020-2023  润新知