0

我有一個Squarespace網站,我爲了增加安全性而將其放在Amazon Cloudfront CDN後面。但是,網站上的表單不再提交。提交按鈕只是閃爍,表單不發送。記錄以下控制檯錯誤:Form使用Amazon CDN提交Squarespace網站的問題

https://www.example.com/api/census/RecordHit 
Failed to load resource: the server responded with a status of 403 (Forbidden) 
https://www.example.com/api/form/FormSubmissionKey 
Failed to load resource: the server responded with a status of 403 (Forbidden) 
https://www.example.com/api/census/RecordHit 
Failed to load resource: the server responded with a status of 403 (Forbidden) 

任何想法發生了什麼和變通?謝謝!

回答

0

403禁止自帶因爲你還沒有設置選項,允許請求類型POST

在CloudFront的分發到:行爲>允許的HTTP方法 選擇選項:GET,HEAD,OPTIONS,PUT,POST ,PATCH,DELETE

另外,如果您在加載網站時遇到問題,請確保使用.squarespace.com作爲原點,而不是ext-cust.squarespace.com。這也困擾了我,我認爲這是與轉發的標題。