How to set hostname for Apache proxy_http


Read more: Running node.js with apache

Simple, you only add one line:

ProxyPreserveHost On

Example:

<VirtualHost *:80>
    ServerAdmin admin@tutorialspots.com
    ServerName tutorialspots.com
    ServerAlias cdn.tutorialspots.com
    ProxyRequests off
    ProxyPreserveHost On
  
    <Location />
        ProxyPass http://localhost:5000/
        ProxyPassReverse http://localhost:5000/
    </Location>
</VirtualHost>

Leave a Reply