nginx 配置Https强转和Cross跨域配置撞车遇到的坑

别再硬啃理论了!用Simulink双脉冲实验,5分钟搞懂MOSFET二极管反向恢复 本文通过Simulink双脉冲实验仿真,帮助电力电子学习者快速理解MOSFET二极管反向恢复特性。文章详细介绍了实验搭建步骤、关键参数配置及波形解析,将抽象理论转化为可视波形,大幅提升学习效率。特别适合需要直观理解反向恢复过程的工程师和学生。 阅读详情

一、背景说明
项目中Https强转逻辑是在nginx层面配置的,Cross跨域逻辑处理是在项目的Java代码层面处理的。
向服务器发起Http跨域请求时,出现Cross跨域逻辑处理失效问题
nginx 中Https 强转配置,如下所示:

if ($server_port = 80 ) {
   rewrite ^(.*)$  https://$host$1 permanent;
}

Cross跨域逻辑处理层,代码如下所示:

String originUrl = request.getHeader("origin");//请求的地址
if (StringUtils.isNotEmpty(originUrl)){
       if (originUrl.endsWith("test.com")){
           response.setHeader("Access-Control-Allow-Origin", originUrl);
           response.setHeader("Access-Control-Allow-Credentials", "true");
           response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
           response.setHeader("Access-Control-Max-Age", "1800");//30分钟
           response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept,frLo");
      }
      if (request.getMethod().equalsIgnoreCase(HttpMethod.OPTIONS.name())) {   
           response.setStatus(200);
           return false;
     }
}

二、问题描述

1)例如:在sun.test.com系统中,使用JS脚本发起Ajax请求,向my.timer.com服务器发起Http请求,my.timer.com服务器中配置了以上的Https强转和Cross逻辑处理代码。
2)my.timer.com 服务器的nginx收到Http请求后,会执行Https强转,然后发起重定向rewrite Https请求,此时由于发起了重定向请求导致原跨域请求header中的origin 参数丢失
注:rewrite 和 return 301 https://$host$request_uri; 都会导致header 中的orgin参数丢失,因为两种方式都是发起重定向请求
3) my.timer.com 服务器再次收到第2步重定向后的Https请求,由于header中的origin参数丢失,最终导致后端java  Cross跨域处理逻辑失效,由于Cross 是否跨域请求都是借助header中的origin参数来处理的

三、问题尝试解决

1)考虑在nginx中 rewrite之前 使用   add_header 'Origin' $http_origin;  添加header,无法解决问题,因为rewrite 是重定向请求,add_header 无法生效

2)将Cross 跨域逻辑处理转移到nginx中配置如下所示:

set $cors "false";
if ($http_origin ~* "(test.com)") {
      set $cors "true0";
}
if ($request_method = 'OPTIONS') {
    set $cors "true1";
}
if ($cors = "true0") {
      add_header 'Access-Control-Allow-Origin' "$http_origin";
      add_header 'Access-Control-Allow-Credentials' 'true';
      add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
      add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
      add_header 'Access-Control-Max-Age' 1728000;
}
if ($cors = "true1") {
  add_header 'Access-Control-Allow-Origin' "$http_origin";
  add_header 'Access-Control-Allow-Credentials' 'true';
  add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  add_header 'Access-Control-Allow-Headers' 'Origin,X-Requested-With,Content-Type,Accept,frLo';
  add_header 'Access-Control-Max-Age' 1728000;
  return 200;
}
if ($server_port = 80 ) {
	 rewrite ^(.*)$  https://$host$1 permanent;
}

还是无法解决以上问题

四、解决方案

未找到完美解决方案,只能让sun.test.com系统中发起跨域Ajax请求时,默认使用Https协议请求服务器,避开服务的Http请求强转。

MATLAB GUI 水果成熟度分级系统设计与实现 本文基于 MATLAB GUI 设计并实现了一款水果成熟度分级系统,能够准确地评估水果的成熟程度。在实现过程中,我们运用了 MATLAB 中的函数实现对图像的处理和分析,同时使用 GUI 界面增加了系统的易用性。值得一提的是,在实际操作中,我们应该结合实际需求对系统进行相应的改进与完善,以满足不同领域和应用场景下的需求。实验结果表明,本系统可以有效地检测出水果的成熟度,并对其进行精准的评分。因此,本文设计并实现了一款基于 MATLAB GUI 的水果成熟度分级系统。三、MATLAB 代码实现。 阅读详情

相关推荐

Wireshark抓包分析:如何从HTTP流量中快速定位黑客攻击痕迹(附pcap文件)

本文通过Wireshark实战,详细解析了如何从HTTP流量中快速定位黑客攻击痕迹。文章提供了核心过滤策略,并重点剖析了如何识别SQL注入攻击的流量特征、揭露WebShell的隐蔽通信以及追踪攻击者在横向移动中的行为,帮助安全人员系统性地从pcap文件中还原完整攻击链。

sprite的博客 1009

CROS错误 403 preflight 预检

CROS错误 403 preflight 预检

m0_55546349的博客 2430

NXP ChessDE的安装和激活

如果客户申请的是试用版,那么一份为期 30 天的 License 将会发送申请人的账号或邮箱中,客户使用该文件进行安装即可。② 将“VENDOR snpslmd /path/to/snpslmd”中的“/path/to/snpslmd”替换成 snpslmd.exe 实际存放路径(位于 SCL 安装目录下的 win32\bin 文件夹中,默认安装的情况下就是“VENDOR snpslmd C:\Synopsys\SCL\<version>\win32\bin\snpslmd.exe”)。

weixin_47351160的博客 2043

原因:cors 请求未能成功_Cors最佳实践

基础知识CORS(Cross-Origin Resource Sharing),跨域资源共享,是浏览器跨域的官方解决方案。相比其他常见的跨域解决方案(jsonp、iframe、postMessage),CORS具有以下优点:前端代码优雅。CORS由浏览器和后台交互完成,前端开发者感受不到和同源通信的差别,代码完全一样;规范标准,兼容性好,IE10以上都支持,浏览器之间几乎没有差异;支持所...

weixin_39837352的博客 4242

SAP MTO模式实战:从库存管理到成本核算的深度解析

本文深入解析SAP MTO(Make-to-Order)模式在制造业中的应用,从库存管理到成本核算的全流程实战技巧。通过对比MTS模式,详细阐述MTO的核心逻辑、库存管理配置、成本核算路径及与PP模块的集成要点,帮助企业实现按单生产的高效管理,优化库存水平和资金占用。

weixin_29204205的博客 709

PnP 单目相机位姿估计(二):solvePnP利用二维码求解相机世界坐标

前言 原理简介 输入参数准备 1 objectPoints特征点世界坐标 2 imagePoints特征点在摄像头下的像素点坐标 3cameraMatrixdistCoeffs内参矩阵和畸变矩阵 相机世界坐标的求解 1求世界坐标中的点在相机坐标系下的坐标 2求相机在世界坐标中的坐标 3效果求解相机在世界坐标系下的坐标点 4求解代码1.前言  很多时候,当我们利用单目相机获取图像时,往往只能获取图像中

cocoaqin的博客 5万+

跨域资源共享 CORS 详解

跨域资源共享 CORS 详解作者:阮一峰日期:2016年4月12日CORS是一个W3C标准,全称是"跨域资源共享"(Cross-origin resource sharing)。它允许浏览器向跨源服务器,发出XMLHttpRequest请求,从而克服了AJAX只能同源使用的限制。本文详细介绍CORS的内部机制。(图片说明:摄于阿联酋艾因(Al Ain)的绿洲公园)一、简介...

weixin_34365417的博客 2573

6、Cocos2D游戏开发:精灵添加与角色实现

本文详细介绍了在Cocos2D游戏开发中如何添加背景精灵和玩家角色精灵。通过创建GameScene场景、组织项目资源、使用多分辨率图像适配不同设备,并深入讲解了将角色拆分为上下半身以实现更真实瞄准效果的原理。文章还解析了Cocos2D的图像搜索机制、锚点概念及其应用,以及如何通过父子节点关系管理复合角色。最终实现了猎人角色在场景中的正确显示与定位,为后续动画和交互功能打下基础。

e3f4g5的博客 90

Spring 处理跨域请求

Spring 处理跨域请求

weixin_42683274的博客 881

ZYNQ PL通过EMIO ETHE1外接PHY由GMII转RGMII

1,设置EMIO方式引出ETHE1 2,从GMII过度到RGMII GMII: 发送 gmii_tx_clk gmii_tx_d[7:0] gmii_tx_en gmii_tx_er 接收 gmii_rx_clk gmii_rx_d[7:0] gmii_rx_dv gmii_rx_er RGMII: 发送 tx_clk tx_d[3:0] tx_ctrl 接收 rx_clk rx_d[3:0] rx_ctrl 首先数据总线从时钟单边沿采样8bit转变为了双边沿采样4bit,从88E1

wangjie36的博客 1万+

【数据同化第二期】数据同化中三大理论基础之一(最小方差估计)

【数据同化第二期】深入理解数据同化及经典案例(最小方差估计)

WW、forever的博客 1596

Springboot+Vue进行跨域访问时GET正常,但POST 403的解决方案

(65条消息) 【跨域异常】get请求能访问,但是post请求报403跨域异常_get可以跨域 post不能跨域_weiambt的博客-优快云博客。根据控制台报的错能很快锁定是跨域问题,但是搜索了十多个相关的解决办法帖子,要么不适用,要么就是禁用Spring Security。此贴非常详细的介绍了CORS解决浏览器跨域的原理,对我这个小白来说非常友好。本人跟着的是“程序员青戈”的b站springboot+vue的小白教学视频做的,看到p9的时候出现了 前端。保护,尝试过后者,但是并没有什么卵用。

boluotangbao的博客 3456

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

原因:cors 请求未能成功_CORS跨域漏洞学习

简介网站如果存CORS跨域漏洞就会有用户敏感数据被窃取的风险。跨域资源共享(CORS)是一种浏览器机制,可实现对位于给定域外部的资源的受控访问。它扩展了同源策略(SOP)并增加了灵活性。但是,如果网站的CORS策略配置和实施不当,它也可能带来基于跨域的攻击。CORS并不是针对跨域攻击(例如跨站点请求伪造(CSRF))的保护措施。同源策略这里我们必须要了解一下同源策略:同源策略是一种限制性...

weixin_39963174的博客 2921

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

Firefox浏览器报错:CORS请求未能成功

最近在开发中遇到个问题,项目部署完后在Google浏览器能正常使用,但是在Firefox浏览器报跨域拦截(CORS请求未能成功);经检查后端代码以及Nginx都已经配置了跨域相关的代码,按理不应该在出现跨域问题啊。经排查发现问题出在证书上,Firefox认为后端证书不安全从而进行了拦截,好像是项目的域名与证书不一致导致。证书管理器弹窗里切到服务器部分,点击添加例外,再把需要信任的地址添加进去,就可以正常访问了。由于这是浏览器的安全机制做的拦截,只要让浏览器信任该证书就行。...

snowflakelm的博客 8230

403 Invalid CORS request 跨域问题

跨域问题是浏览器对于ajax请求的一种安全限制: 一个页面发起的ajax请求,只能是与当前页面域名相同的路径, 这能有效的阻止跨站攻击。2).域名相同,端口不同: www.country.com:8080 , www.country.com:8081。3).二级域名不同: a.country.com , b.country.com。1).域名不同: www.baidu.com , www.google.com。CORS是一种规范化的跨域请求解决方案,安全可靠。四. 跨域问题是怎么来的。

qq_16815191的博客 2197

spring 403 Invalid CORS request 跨域问题

@CrossOrigin(origins = "*",maxAge = 3600)

tmjianjun的博客 1008

WebMvcConfigurerAdapter各个方法的作用

public abstract class WebMvcConfigurerAdapter implements WebMvcConfigurer { /** 设置匹配路由请求规则 **/ public void configurePathMatch(PathMatchConfigurer configurer) { } /** 配置内容裁决的一些选项 **/ public void configureContentNegotiation(ContentNegotiationConfigure

u013343616的博客 450

向请求头添加自定义属性,实现token功能时,出现CORS跨域导致请求失败( has been blocked by CORS policy: ... No ‘Access-Control-All)

场景:在使用 SpringBoot + Vue 进行前后端分离的开发过程中,部分功能是需要当用户登陆成功时后端(SpringBoot)向前端(Vue)返回一个token值,前端将这个token值放在以后每个请求的请求头中,后端先从拦截器中验证token值的存在,再放行请求,以确保不会被别人恶意修改、删除数据,结果出现了CORS跨域导致请求失败的情况。非简单请求的CORS请求,会在正式通信之前,增加一次HTTP查询请求,称为 “预检” 请求(preflight)。由于在后端拦截器中拦截了所有的请求,

piglite的专栏 3275

解决 strict-origin-when-cross-origin 问题

使用90版本之后的谷歌浏览器, 在部署前端项目后, 调用后端接口出现 strict-origin-when-cross-origin, 并且静态资源被拦截的情况的解决

时间静止 18万+

CORS跨域

当一个请求的url的协议、域名、端口任意一个与当前页面的url不同即为跨域。a页面想获取b页面的资源,a与b页面的协议、域名或端口号不同,进行的访问行为都是跨域,由于浏览器的同源策略,会限制跨域请求资源。

qq_64497094的博客 475

403错误通常表示服务器理解请求,但拒绝执行。这可能涉及权限、配置、CORS、安全设置等问题。分步骤分析可能的原因

403错误通常表示服务器理解请求,但拒绝执行。这可能涉及权限、配置、CORS、安全设置等问题。分步骤分析可能的原因

爱的叹息的专栏 1611

CORS on Nginx

The following Nginx configuration enables CORS, with support for preflight requests. # # Wide-open CORS config for nginx # location / { if ($request_method = 'OPTIONS') { add_header 'A...

huangbaokang的博客 800

nginx 开启https时反向代理http服务的问题

当我们用nginx开启https时,反向代理一个本地的http服务,会遭遇跨域问题,报错。,导致很多资源无法加载。

Star_tears的博客 2086

CORS解决跨域问题(403问题)

1、什么是跨域问题?   跨域问题是浏览器对于ajax请求的一种安全限制:一个页面发起的ajax请求,只能是用当前页同域名同端口的路径,这能有效的阻止跨站攻击。 2、跨域问题出现的条件:   1、跨域问题是ajax请求特有的问题。   2、前后端的域名、端口不一致。 3、CORS跨域解决原理简单分析:   CORS需要浏览器和服务器的同时支持。   浏...

weixin_30622181的博客 1035

Nginx配置HTTPS,前端访问正常,后端报错strict-origin-when-cross-origin

Nginx配置HTTPS,前端HTTPS访问正常,后端HTPPS无法访问 报错strict-origin-when-cross-origin 原因:Nginx 给前端配置了 SSL 证书,但是后端没有配置SSL证书,导致前端HTTPS访问正常,但后端无法使用HTTPS。 解决办法: 举例:Flask 后端 后端配置 ssl_context ...

Sareyer的博客 9471

Nginx配置HTTPS 访问前端报错 strict-origin-when-cross-origin

Nginx conf 文件 配置 http 以及 https 后,http可以正常访问前端页面,https访问报错:strict-origin-when-cross-origin,尝试:检查443端口状态,并重新加载防火墙配置。 1.查看443端口状态 firewall-cmd --add-port=443/tcp --zone=public --permanent 正常则返回:success 2.重新加载 firewall-cmd --reload ...

Sareyer的博客 1万+
上一篇: CMS 升级到G1遇到RSS内存泄漏问题
下一篇: Spring Orika Bean Copy 属性丢失问题说明
TimerBin
博客等级 码龄12年 54粉丝 119原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值