Configuring reverse proxy for python script

May 19, 2005
8
0
151
I am struggling to configure apache to reverse proxy to a python webserver running on port 5000. This is the configuration i have used on a regular server without cpanel. Ive put this in the pre and post include section but neither work. What am i doing wrong?
Code:
<VirtualHost *:80>
   ServerName sub.domain.com

   ProxyRequests Off
   ProxyVia Off

       <Proxy *>
             Require all granted
       </Proxy>

   SSLProxyEngine          On
       ProxyPass / http://localhost:5000/
       ProxyPassReverse / http://localhost:5000/
</VirtualHost>
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
Hello,

There's no support for a reverse proxy configuration in cPanel, but if you want those particular entries (minus the <VirtualHost> tags)
added to all virtual hosts on the server (or just a single virtual host), then you'd use the instructions documented at:

Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation

Remember to run the following command after setting up a custom include file:

Code:
/usr/local/cpanel/scripts/ensure_vhost_includes --all-users
Thank you.