未将此分发配置为允许HTTP请求 [英] This distribution is not configured to allow the HTTP request

查看:120
本文介绍了未将此分发配置为允许HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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登录表单,成功登录后,它将按照以下方式重定向用户:

I have configure the website to only accept https on amazon cloudfront. In a nutshell, you have a php login form, and upon successful login it redirects the user as follow:

 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使用的源.

What the error is trying to tell you is that you cannot use POST. Going to guess that cacheable means GET in this context. You need to go ahead and configure cloud front to allow "upload requests" like POST, PUT, etc. IN this case the request will go to the origin that Cloudfront uses.

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方法.

Look for Allowed HTTP Methods in last link.

这篇关于未将此分发配置为允许HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆