Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services REST API不工作,使用https/ssl重定向_Amazon Web Services_Go_Amazon Ec2_Https - Fatal编程技术网

Amazon web services REST API不工作,使用https/ssl重定向

Amazon web services REST API不工作,使用https/ssl重定向,amazon-web-services,go,amazon-ec2,https,Amazon Web Services,Go,Amazon Ec2,Https,我用angular 5和golang的REST API构建和应用程序,并将它们托管在aws ec2实例上,我安装了ssl证书以在https上运行应用程序和API。下面是我运行应用程序和api的url结构(api在8080端口上运行 应用程序: api: 当我在系统的主机文件中设置好ip后点击api时,它可以正常工作,但不能与aws一起工作,并重定向到我点击任何api时,如或 也不确定这里的问题是什么,但其他一切都很好 我正在使用gin-gonic as-go框架,并按照建议使用了RunTLS。我

我用angular 5和golang的REST API构建和应用程序,并将它们托管在aws ec2实例上,我安装了ssl证书以在https上运行应用程序和API。下面是我运行应用程序和api的url结构(api在8080端口上运行

应用程序: api:

当我在系统的主机文件中设置好ip后点击api时,它可以正常工作,但不能与aws一起工作,并重定向到我点击任何api时,如或

也不确定这里的问题是什么,但其他一切都很好


我正在使用gin-gonic as-go框架,并按照建议使用了RunTLS。

我不确定我是否完全理解这个问题,但以防万一,您是否在API服务器上设置了CORS()

如果您运行从ORIGIN1提供服务的浏览器应用程序,并且浏览器尝试访问DESTINATION2上的API,则API服务器必须向浏览器声明,它确实有权回复来自ORIGIN1的浏览器

例如,您可以使用向API服务器添加CORS支持。
祝你好运。

检查网络日志。根据你获取的方式,你可能需要告诉代码遵循重定向。CORS有时在飞行前可能会很愚蠢。一些获取方法需要在CORS飞行前被告知遵循重定向