Vhost.conf configuration

Discussion in 'Installation/Configuration' started by francoisPE, Jan 9, 2021.

  1. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Hello,
    My issue is a little bit outside ISPConfig configuration. But it is linked with my server conf with ISP
    I am trying to set up a proxy:
    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
    AuthUserFile /etc/backend/back.htpswd
    AuthName "Service"
    AuthType Basic
    Require valid-user
    Options None
    </Proxy>
    ProxyPass "/" "http://localhost:3000/" connectiontimeout=10 timeout=300 keepalive=on
    ProxyPassReverse "/" "http://localhost:3000/"

    This works very well. I access it at : myvhost.tld
    But, I would like to acces it at : myvhost.tld/service
    So I edit my vhost.conf :

    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
    AuthUserFile /etc/backend/back.htpswd
    AuthName "Service"
    AuthType Basic
    Require valid-user
    Options None
    </Proxy>
    ProxyPass "/service" "http://localhost:3000/" connectiontimeout=10 timeout=300 keepalive=on
    ProxyPassReverse "/service" "http://localhost:3000/"

    It doesn't work ! curl http://localhost:3000/ answers "Found. Redirecting to /cluster/ns"

    In my browser, I see : myvhost.tld/cluster/ns instead of myvhost.tld/service/cluster/ns

    I try modify ProxyPassReverse, add Rewriterules, Redirect Permanent... without any success !
     
    Last edited: Jan 11, 2021
  2. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Any idea ?
     
  3. francoisPE

    francoisPE Active Member HowtoForge Supporter

    May be there is no solution...
    If there is, could you tell me where to look for : rewriterules, or ???
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Put your ProxyPass* directives in a <Location>:
    Code:
      <Location /service>
        ProxyPass                  "http://127.0.0.1:3000"
        ProxyPassReverse           "http://127.0.0.1:3000"
        ProxyPreserveHost          On
        ProxyPassReverseCookiePath "/"  "/service/"
      </Location>
    
     
    ahrasis likes this.
  5. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I tried that code, but, it doesn't work.
    Behind "http://127.0.0.1:3000", there is nodejs running ! nodejs redirect without taking into account apache conf...
    I don't understand why, and, how to solve that !
     
  6. francoisPE

    francoisPE Active Member HowtoForge Supporter

    As an example, in firefox : "ns1.domain.tld:8080/service" gives back "ns1.domain.tld:8080/cluster/ns"
    I rewrite in browser : ns1.domain.tld:8080/service/cluster/ns
    and it gives that -> attached scripts are not going through "location"...

    Snipaste_2021-01-24_21-39-26.png
     
  7. Steini86

    Steini86 Active Member

    Last edited: Jan 24, 2021
  8. Monica Benson

    Monica Benson New Member

    I don't think ProxyPassReverse does anything here.
     
  9. francoisPE

    francoisPE Active Member HowtoForge Supporter

  10. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    What mod_proxy* modules do you have enabled? Ensure mod_proxy and mod_proxy_http are loaded, and you might try mod_proxy_html as well (see https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassreverse).

    Not sure what you mean, but I assume you mean a node.js opcache? (I don't know much about node.js, sorry.)
     
  11. francoisPE

    francoisPE Active Member HowtoForge Supporter

    It seems you rescue me with that solution ! Thanks a lot :)
    Regarding Opcache : that github (https://raw.githubusercontent.com/rlerdorf/opcache-status) helps monitor opcache. It uses external sources. i understood that with ispconfig 3.2.2, it is no more possible to upload that external sources using myisp.domain.tld:8080/opcachestatus ! That is why I change my approach.
    :) Thanks so much !
     

Share This Page