I've been trying to deploy a very simple flask app onto AWS. But I just can't seem to make it work. It always gives me the same error that favicon.ico is not found in the console and gives me a 502 bad gateway error.
Solutions I've tried:
- Tried saving it to Amazon S3 bucket and reference it from there. Didn't work. Gave me the same error.
base.html has the following line
<link rel="icon" type="image/png" href="https://elasticbeanstalk-us-east-1-503477540785.s3.amazonaws.com/favicon.ico">
application.py has the following route
@application.route('/favicon.ico')
def favicon():
return Response(headers={'Location': 'https://elasticbeanstalk-us-east-1-503477540785.s3.amazonaws.com/favicon.ico'}, status=200)
I tried changing the status to 301 too, didn't change anything.
When I try to go to local-website/favicon.ico, it redirects me to https://elasticbeanstalk-us-east-1-503477540785.s3.amazonaws.com/favicon.ico. But when I save it locally and try to go to the same url, the .ico file loads up at http://127.0.0.1:5000/favicon.ico.
How do I make this work?