Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ProxyPass/ModProxy Issue

Discussion in 'EasyApache' started by zizizizz, Feb 21, 2018.

  1. zizizizz

    zizizizz Registered

    Feb 21, 2018
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Dear Sir or Madam,

    Please excuse the likely blatantly obvious solution to this problem, but I have been speaking with server support for 4 days on how to get this working and they haven't been able to solve or even tell me how I am meant to fix this issue.

    Our server has cpanel/whm/easy_apache4 and has three domains that are currently being served by apache (They are have applications created under Create a New Account)

    I have a docker image that is running a server (gunicorn/django) on localhost:8000 and have a fourth domain name that I want to make use of on the server. I have not created an account for it because it isn't serving files from public_html or anything like the other three.

    I was hoping apache would send traffic to localhost:8000 if the $host_name =
    so in WHM I have added this (below) to the pre_virtual_host in the Include Editor

    Home »Service Configuration »Apache Configuration »Include Editor
    <VirtualHost *:80>
    # Let apache serve static files
    ProxyPreserveHost On
    ProxyPass /static/ !
    ProxyPass /media/ !
    Alias /static/ /home/app/static/
    Alias /media/ /home/app/media/
    # Gunicorn handle the others
    ProxyPass / http://localhost:8000/
    ProxyPassReverse / http://localhost:8000/
    But it never seems like Apache reads the file and the the url for never resolves. (curl localhost:8000 on the server has a 200 response) but going to it via just gives the
    "SORRY! If you are the owner of this website, please contact your hosting provider" message.

    Serving the application on a port other than 80 works too but is non-ideal and would rather have apache act as the reverse proxy.

    Are there additional steps to take?

    Thank you,

    #1 zizizizz, Feb 21, 2018
    Last edited by a moderator: Feb 21, 2018
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    You can try setting up an account for the domain name on the cPanel server, and then implement a custom include file for it using the instructions at:

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

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

    /usr/local/cpanel/scripts/ensure_vhost_includes --all-users
    Additionally, I encourage you to vote for the following feature request if you'd like to see native support for Django offered in cPanel & WHM:

    Django support

    Thank you.
Similar Threads - ProxyPass ModProxy Issue
  1. amanfredini

Share This Page