0

I successfully setup an Apache that acts as reverse proxy (with basic auth and https) for a service running on a machine in my local network.

Connecting from the internet works fine but if i want to connect from lan some clients (e.g. java based) have problems with to connect (certificate problem).

Because of that and for convenience i want allow local machines to connect via http and without basic auth. How to achieve this?

This are my current virtual hosts:

<VirtualHost _default_:80>
    DocumentRoot "${SRVROOT}/htdocs"
    #ServerName www.example.com:80
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin gmail.com
    ServerName <some domain>

    ProxyPreserveHost On
    ProxyRequests Off
    ProxyVia Off
    ProxyPass / http://127.0.0.1:8082/
    ProxyPassReverse / http://127.0.0.1:8082/
    <Location />    
        AuthUserFile "...passwd.txt"
        AuthName "secured"
        AuthType Basic
        Require valid-user
    </Location>

        Alias /.well-known C:/xampp/htdocs/.well-known

    SSLEngine on
    SSLCertificateFile "...chain.pem"
    SSLCertificateKeyFile "...key.pem"
    SSLCertificateChainFile "...-crt.pem"
</VirtualHost>

The first one is needed to renew the letsencrypt certificate. the second one is the one i want to open for local machines (http without basic auth)

1

You can use the same proxy directives but with a block restricting by IP address or network. Add something similar, plus any other directives that are required, to the following to your port 80 vhost:

ProxyPass / http://127.0.0.1:8082/
ProxyPassReverse / http://127.0.0.1:8082/
<Location />
require ip <local network in CIDR notation>
</Location>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.