I have a sort of weird problem with a Dockerized Flask application currently being hosted through CloudFront. Essentially the issue is that one of the pages for this website, which is completely static, will show a 502 CloudFront error sometimes when it is requested by the user. Other times, the page loads normally. Refreshing the same page multiple times will either load a 502 error or the actual page. There seems to be no pattern to this behavior.
The routing is done via Flask. Without posting all of the source code, is there any common error that can cause this behavior? The Flask app doesn't change, but it does produce different results. This is only for one page and the other pages load normally with no issue.
Thank you for any insight in advance.