Patan
Patan

Reputation: 17893

Virtual host based on Context Path

<VirtualHost _default_:80>
    DocumentRoot /var/www/html
    ServerName host.company.com
    JkMount  /a/* worker_1
    JkMount  /b/* worker_2
</VirtualHost>

Virtual Host based on the server context path.

Is it possible to have differentiate virtual host if url starts with /r

Upvotes: 1

Views: 1978

Answers (1)

Dusan Bajic
Dusan Bajic

Reputation: 10889

Something like this should work:

<VirtualHost _default_:80>
    DocumentRoot /var/www/html
    ServerName localhost

    <Location /a/>
    AuthType Basic
    AuthName "Path A"
    Require valid-user
    AuthUserFile passwords/a.htpasswd

    ProxyPass "http://localhost:8000/"

    </Location>

    <Location /b/>
    AuthType Basic
    AuthName "Path b"
    Require valid-user
    AuthUserFile passwords/b.htpasswd

    ProxyPass "http://localhost:8001/"

    </Location>
</VirtualHost>

Upvotes: 1

Related Questions