S
S
silentvick2015-07-24 14:14:39
Apache HTTP Server
silentvick, 2015-07-24 14:14:39

Why won't apache let me in?

At the root of the project is a file to which I restrict access via .htaccess (located in the same place), while allowing access from a specific ip:

<Files private.php>
order deny,allow
deny from all
allow from <ip>
</Files>

But when accessing from the specified ip, I get a 403 error. What could be the problem?
The server is running Apache 2.2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
silentvick, 2015-07-27
@silentvick

It turned out that apache is behind a reverse proxy. I solved it with this config:

SetEnvIF X-Forwarded-For "x.x.x.x" AllowIP
<Files private.php>
order deny,allow
deny from all
allow from env=AllowIP
</Files>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question