"Host not allowed" error while deploying game framework application on Amazon AWS with Boxfuse

I am trying to deploy a simple web application written using the Play Framework in Scala, an Amazon web service.

The web application is working fine in development mode and production mode on my local computer, and I changed its default port to 80.

I used Boxfuse to deploy to AWS, as suggested.

First I run sbt dist then " boxfuse run -env = prod "

Everything went well. The image is merged and placed in AWS. Created by AMI. The instance was started and the application was started.

i-0f696ff22df4a2b71 => 2017-07-13 01: 28: 23.940 [info] play.api.Play - The application (Prod) has been launched

Then an error message appeared:

WARNING: Healthcheck ( http://35.156.38.90/ ) returned 400 instead of 200. Retrying within the next 300 seconds ...

i-0f696ff22df4a2b71 => 2017-07-13 01: 28: 24.977 [info] pcsAkkaHttpServer - Listening to HTTP at /0.0.0.0:80

i-0f696ff22df4a2b71 => 2017-07-13 01: 28: 25.512 [warn] pfhAllowedHostsFilter - The host is not allowed: 35.156.38.90

The instance was interrupted after retrying after 3 minutes. He gave a warning:

Make sure your application responds with an HTTP port of 80 at / on

But I made sure that the application is responding on the local computer, and I tried both Windows and Ubuntu, everything works well.

Also, when I run "boxfuse run" on the local computer, I can connect to it using " http: // localhost ", but it still has an error.

Hope someone with experience can give me some advice. Thanks in advance.

ps: not sure if necessary, I added these parameters to application.conf

http { address = 0.0.0.0 port = 80 } 
+7
scala amazon-web-services playframework boxfuse
source share
2 answers

Judging by the error message, it seems that the problem may be related to play.filters.hosts.allowed not configured in application.conf . The filter allows you to configure which hosts can access your application. More information on the playback filter is available here .

Here is a typical configuration example:

 play.filters.hosts { allowed = ["."] } 
+4
source share

As stated in Boxfuse Download Documentation :

If your application uses the allowed hosts filter, you need to make sure that play.filters.hosts.allowed in application.conf allows you to connect from anywhere, as this filter otherwise will cause ELB to fail. For example:

 play.filters.hosts { allowed = ["."] } 

Additional information in the official documentation for reproduction.

+15
source share

All Articles