Proxypass not working

Discussion in 'Installation/Configuration' started by jacksharing, May 20, 2014.

  1. jacksharing

    jacksharing New Member

    Hi all,

    I want my sub.domain.tld to divert to my other internal server. On my sub.domain.tld's Apache Directive box i put:

    <VirtualHost *:80>
    Servername sub.domain.tld
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.22:80/
    ProxyPassReverse / http://192.168.1.22:80/
    </VirtualHost>

    but when i try to access the site, it still showing the ISPConfig default index page.

    Any idea?

    thanks
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    That can't work. The content from the directives box is put into the VirtualHost section.

    Try putting just
    Code:
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.22:80/
    ProxyPassReverse / http://192.168.1.22:80/
    in it.
     
  3. jacksharing

    jacksharing New Member

    Perfect! Its working!

    Thanks a lot Croydon!
     
  4. Uysim

    Uysim New Member

    I see no different between these
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    There is a huge difference. The first post is a complete vhots which you can not use while the post from @Croydon contains just the correct proxy lines like they can be added in the apache directives field in ISPConfig.
     
  6. Uysim

    Uysim New Member

    I don't understand I see your code and his code is 100% the same.
     
  7. Uysim

    Uysim New Member

    Till can you help explain me about. I understand that code from @Croydon is working. But I want to know why it worked? Because what I see they use the same one below

    ProxyPreserveHost On
    ProxyPass / http://192.168.1.22:80/
    ProxyPassReverse / http://192.168.1.22:80/
     
  8. concept21

    concept21 Active Member

    Their position in the apache config files are different. :D
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    First, the code is nowhere the same. Code from the first post:

    Code:
    <VirtualHost *:80>
    Servername sub.domain.tld
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.22:80/
    ProxyPassReverse / http://192.168.1.22:80/
    </VirtualHost>
    code from @Croydon :

    Code:
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.22:80/
    ProxyPassReverse / http://192.168.1.22:80/
    as you see, the first code has 6 lines, the other one has just 3, so it's easy to see why it's not the same.

    So why can the first code not work: The apache web server does not support it to put a "<VirtualHost *:80>" section inside another "<VirtualHost *:80>" section. An ISPConfig website is already a virtual host, so you can not add a second virtual host inside and in addition to that, it is not necessary at all. That's why the code from @Croydon neither contains a virtualhost section nor does it contain a ServerName line as that's superfluous as well.
     

Share This Page