In deploying a new app to EB, I found that the .ebextensions
files that concern httpd
are not being deployed to /etc
.
The files as such are the same as the ones from another app, like this one:
/.ebextensions/cors.config
files:
/etc/httpd/conf.d/cors.conf:
mode: "000644"
owner: webapp
group: webapp
content: |
SetEnvIf Origin "^https?:\/\/localhost:[0-9]+.*|https?:\/\/127.0.0.1[:[0-9]+]?|https:\/\/mywebsite.com" REQUEST_ORIGIN=$0
Header always add Access-Control-Allow-Origin %{REQUEST_ORIGIN}e env=REQUEST_ORIGIN
Header add Access-Control-Allow-Headers "content-type, authorization"
Header add Access-Control-Allow-Methods "GET, OPTIONS, POST, PUT, PATCH, DELETE"
Header add Access-Control-Max-Age "86400"
Otherwise are identical to the ones provided by AWS in this depository
Note that I do have a file that is correctly deployed to /etc/php.d
, so it would seem that the .ebextensions
deployment overall is working.
The issue seems to be related to Apache. When configuring the environment I did notice a new selection to be made between Apache and Nginx. I did select Apache.
I am a bit out of ideas at this stage.
You need to create this directory structure in your application root
.platform/httpd/conf.d/
and put your apache config files in it.Refer to this article for more info: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html