My local machine is a virtual CeontOS-7 with a Python 2.7 virtual file containing the Flask application directory, the structure is as follows:
/var /www /myAppenv /myApp /.ebextensions myApp-env.config /.elasticbeanstalk application.py requirements.txt /flaskApp /core views.py models.py forms.py /templates /static
and I am deploying it from / myApp using the EB CLI deployment to a Beanstalk application named myApp with an environment named myApp-env.
I think the path of the static files is set directly in /.ebextensions/myApp-env.config:
option_settings: "aws:elasticbeanstalk:container:python:staticfiles": "/static/": "flaskApp/static/"
and I see in the AWS web console-> environment-> Configurations-> Software Configuration, which
StaticFiles: /static/=flaskApp/static/
therefore, setting the path is not the cause of the problem.
Therefore, when I open a web page for my application, I see that the page is missing css and js, since everything from the static directory receives a forbidden 403 response:
GET http://myApp-dev.elasticbeanstalk.com/ [HTTP/1.1 200 OK 174ms] GET http://myApp-dev.elasticbeanstalk.com/static/bootstrap-3.3.5-dist/js/bootstrap.min.js [HTTP/1.1 403 Forbidden 55ms] ...
Guessing something about permissions, because my linux account belongs to my local repository files (for samba reasons), then I tried to use the root root and chgrp root (static permissions for files and files 755), but this is not so, do not change anything. Actually, I donβt think this is due to the / selinux firewall, the fact that the main page is loading.
Does anyone know how to solve this problem?