AWS EB Flask does not recognize static files


I’m having issue with hosting Flask App on AWS with Elastic Beanstalk.
I followed document on AWS(which seems a little old?), and did some workaround suggested here. It works if I have this folder structure:

However, I want to make my application more structured. So I moved my folder structure to and it stopped working

What I have tried is changing the settings in optionsettings.myapp-env, suggested here. But I got no luck.

(P.S. App works fine except not recognizing the static files folder)

Any help would be appreciated!


Looks like you need to change the path mapping to:
“/static/”: “app/static/”

This mapping maps the virtual (what you refer in your html) to the directory structure. Since you have changed the dirs, now you need to change the mapping too.

Alternatively you can do the same conf in the AWS Beanstalk web console as well. Need not do in the configuration files.

Leave a Reply