Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache HTTP Auth: .htaccess file is not read with a proxy #519

Closed
pixel-paul opened this issue Feb 24, 2023 · 1 comment
Closed

Apache HTTP Auth: .htaccess file is not read with a proxy #519

pixel-paul opened this issue Feb 24, 2023 · 1 comment

Comments

@pixel-paul
Copy link

When a 'Protected Directory' is created, the config is inserted into the .htaccess file saved to the website documents sub-directory.

If a proxy is set up, Apache does not read the .htaccess file in this sub-directory.

In order to use HTTP Auth with a Proxy, the config can be inserted into the httpd.conf file within a Location block:

Example Proxy in directive:

ProxyPass /.well-known !
ProxyRemote / http://localhost:3002
ProxyPreserveHost on
ProxyPass / http://localhost:3002/
ProxyPassReverse / http://localhost:3002/

Example HTTP Auth in directive:

<Location />
    AuthUserFile "/home/mydomain/domain.tld/public_html/.htpasswd"
    AuthType Basic
    AuthName "staging"
    require valid-user
</Location>
<Files .htpasswd>
    deny from all
</Files>

Is there an advantage to using the .htaccess file over the httpd.conf for configuration?

@pixel-paul
Copy link
Author

Closed in lieu of #967

@pixel-paul pixel-paul closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant