API Gateway/Cloudfront会重定向文件夹访问,该文件夹将返回index.html的express应用程序。

0

【以下的问题经过翻译处理】 我有一个在API Gateway和CloudFront上使用express运行良好的无服务器应用程序。问题出现在访问具有index.html文件的文件夹时 - 它会在循环中重定向到自己。

主应用在这里正常工作: https://d2x40omue01gmu.cloudfront.net/

单击标题中的博客链接,它最终应该转到: https://d2x40omue01gmu.cloudfront.net/blog/

但它被重定向回自己。这是一个API网关的CloudFront。

express应用程序通过返回express.static(browserFolder,{maxAge:'1m'})处理/blog*上的GET。

在本地和Firebase无服务器上,这很好地运行: https://www.findrvparks.com/blog/

任何帮助都将不胜感激。

1 Risposta
0

【以下的回答经过翻译处理】 原来在API网关上将express应用程序运行在子文件夹上意味着我必须将“/prod”前缀添加到express get处理程序,即“/prod/blog*”。

profile picture
ESPERTO
con risposta 6 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande