如何将https提取请求发送到HTTP服务器:混合内容错误
我正在使用NextJS应用程序,其中我正在使用简单的获取来发送一些帖子数据。
我们在localhost上使用了应用程序效果很好,但是当我将其放在服务器上时,会出现以下错误。
混合内容:已加载'https://speechwithai.com/home的页面 通过HTTPS,但请求一个不安全的资源 'http://18.224.190.161:5000/filetotext'。这个请求已经 阻塞内容必须通过https提供。
从和到相同的IP地址( https://speechwithai.com/ )。在后面,我在端口80处运行NGINX到Server WebApp,并以5000为Flask REST API。我正在使用烧瓶,因为我需要Python库来处理某些文件。
我尝试了多个帖子,但没有找到任何解决方案。有人可以帮我吗?
我想要的只是向正在运行的烧瓶API服务器发送请求
http:// someipaddress:5000来自 https://mylivenextjsapplication.com
I am using a NextJs app where I am using a simple fetch to send some POST data.
We I used app on localhost it worked fine but when I put it on the server it got following error.
Mixed Content: The page at 'https://speechwithai.com/home' was loaded
over HTTPS, but requested an insecure resource
'http://18.224.190.161:5000/fileToText'. This request has been
blocked; the content must be served over HTTPS.
The from and to are both on same IP address (https://speechwithai.com/). At the back I am running NGINX to server WebAPP at port 80 and Flask REST API at 5000. I am using Flask because I needed python libraries to process some files.
I tried multiple post but I did not find any solution. Could someone please help me?
All I want is to send a request to my FLASK API server which is running
http://someIPAddress:5000 from https://myLiveNextJsApplication.com
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于这两个服务器都在同一服务器后面运行,并且您已经具有NGINX设置。
按照以下步骤
有像下面的nginx配置之类的东西。
在
/etc/nginx/nginx.conf
中,。
有关更多信息,请访问 https://docs.nginx.com /nginx/admin-guide/web-server/reverse-proxy/
配置UI以使用此blask_api
url = https://speechwithai.com/flask_api
更新烧结路径路由
/blask_api
Since both servers are running behind same server and you already have nginx setup.
follow these steps
with some thing like below
nginx configuration resides in
/etc/nginx/nginx.conf
.
For more information visit https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
configure ui to use this flask_api
url = https://speechwithai.com/flask_api
update flask path route to use
/flask_api