Skip to content

Commit ed2c568

Browse files
authored
Update apache.md
1 parent 1d79724 commit ed2c568

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

best_practices/webserver/apache.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ For now we'll make it simple assuming there is no interruption with any service
1919

2020
_For best practice, we put this code at the top of our .htaccess file_
2121

22-
```AuthType Basic AuthName "Restricted Content" AuthUserFile /var/www/user/apache2/.htpasswd # Required IP's will be granted access without login require ip # Only a person with valid credentials will be redirected require valid-user```
22+
```
23+
AuthType Basic
24+
AuthName "Restricted Content"
25+
AuthUserFile /var/www/user/apache2/.htpasswd
26+
27+
# Required IP's will be granted access without login require ip
28+
# Only a person with valid credentials will be redirected require valid-user
29+
```
2330

2431
#### Method 2: Server with varnish enabled
2532
For a server with varnish enabled, is a different approach needed. All requests that go through varnish will pass the header (X-Forwarded-For), but it may contain some tempered information about the visitors IP.
2633
Because of this modification, the request for immediate access will be denied and the visitor will be asked to login. To make sure this won't happen, we'll add a variable for the header that contains the whitelisted IP-adress.
34+
35+
2736
The code below will do the trick:
2837

2938
_For best practice will we add the IP's to the required list require ip_

0 commit comments

Comments
 (0)