How to configure Varnish as reverse proxy over Apache

Recently I tried configuring Varnish as a reverse proxy over Apache, when trying to access, I get 500 error. I did testing with info.php file that worked but Matomo did not work. Kindly suggest any work around or correct configuration.

Thank You !!

Did you read this FAQ: How do I configure Piwik when the server is installed behind a proxy? - Analytics Platform - Matomo?