This distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests.
我已将网站配置为仅在Amazon Cloudfront上接受https。
简而言之,您将拥有一个php登录表单,成功登录后,它将按照以下方式重定向用户:
if(isset($_POST['login'])){
[...]
echo "<script>window.open('coursePayment.php?crs_id=$crs_id','_self')</script>";
形式如下:
<form style="margin-top:-20px" method='post' action='' class='form-horizontal' role='form'>
<input type="hidden" id="couponCodeLogin" name="couponCodeLogin">
<input type="hidden" id="couponCodeLoginAmount" name="couponCodeLoginAmount">
<br><br>
<div class="group">
<input type='text' class='form-control' name='email' required>
<span class="highlight"></span>
<span class="bar"></span>
<label>Email</label>
</div>
<div class="group">
<input type='password' class='form-control' name='pass' required>
<span class="highlight"></span>
<span class="bar"></span>
<label>Password</label>
</div>
<h5 style="color:#FF6400; cursor:context-menu; margin-top:0px" class="displayForgotPassword">Forgot your password? Click here to retrieve it.</h5><br>
<input type='submit' id='moreInfoButton' name='login' value='Continue' class='btn btn-danger'>
</form>
最佳答案
该错误试图告诉您的是您无法使用POST。在这种情况下,要猜测可缓存意味着GET。您需要继续并配置云前端以允许“上传请求”(如POST,PUT等)。在这种情况下,该请求将到达Cloudfront使用的源。
AWS文档:
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating.html
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating-console.html
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html
在最后一个链接中查找允许的HTTP方法。