Magento2.4.1 502 bad gateway

put this in your apache (httpd) vhost configuration:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Require all granted