gpt4 book ai didi

amazon-ec2 - 端点 api 网关测试正常通过,但部署时出现错误 404

转载 作者:行者123 更新时间:2023-12-03 07:44:32 25 4
gpt4 key购买 nike

请帮帮我。我做错了什么。我想通过 api gataway 访问 ec2 并编写了一个 cloudformation 模板

     paths:
/{proxy+}:
x-amazon-apigateway-any-method:
headers:
Access-Control-Allow-Headers:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Origin:
type: "string"
Content-Type:
type: "string"
authority:
type: "string"
produces:
- "application/json"
parameters:
- name: "proxy"
in: "path"
required: false
type: "string"
responses: {}
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
uri: "http://ec2-1111111111.eu-west-1.compute.amazonaws.com/{proxy}"
requestParameters:
integration.request.header.Content-Type: "'text/html'"
"integration.request.path.proxy": "method.request.path.proxy"
passthroughBehavior: "when_no_match"
httpMethod: ANY
type: "http_proxy

为此,我定义了 1 个端点 http_proxy。当我测试此端点时,一切正常,但一旦我部署 api 并尝试通过浏览器访问,错误 404 就会崩溃

最佳答案

移除并重新部署堆栈后,我实现了页面显示,但仍然无法确保连接的css文件正确连接。

enter image description here

关于amazon-ec2 - 端点 api 网关测试正常通过,但部署时出现错误 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53661266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com