Skip to content

Commit

Permalink
Add Apache LB check
Browse files Browse the repository at this point in the history
  • Loading branch information
Meezaan-ud-Din Abdu Dhil-Jalali Wal-Ikram committed May 14, 2019
1 parent b801819 commit a6544c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM httpd:2.4-alpine
FROM vesica/php72:dev

# Copy files
RUN rm -rf /usr/local/apache2/htdocs/
COPY html /usr/local/apache2/htdocs/
RUN rm -rf /var/www/html
COPY html /var/www/html

ENV LOAD_BALANCER_MODE "1"
ENV LOAD_BALANCER_KEY "KEY"

5 changes: 5 additions & 0 deletions html/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType image/gif "access plus 30 days"
ExpiresByType audio/mp3 "access plus 30 days"

RewriteEngine On
<If "%{ENV:LOAD_BALANCER_MODE} == '1' && %{HTTP:X-LOAD-BALANCER} != %{ENV:LOAD_BALANCER_KEY}">
RewriteRule .* - [F]
</If>

0 comments on commit a6544c8

Please sign in to comment.