-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44c4613
commit 64f0e80
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
user1:$apr1$NxhIYend$y81CRlV0MdpcwK1L/BasF. | ||
user2:$apr1$w2KnEjmu$lrIJjCeGwtyo4.O2AyfNR. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
1. Generate auth file | ||
|
||
``` | ||
htpasswd -c .htpasswd user1 | ||
htpasswd .htpasswd user2 | ||
``` | ||
|
||
2. Verify auth file | ||
|
||
``` | ||
cat .htpasswd | ||
``` | ||
|
||
3. Start app service and nginx | ||
|
||
``` | ||
docker-compose up | ||
``` | ||
|
||
4. Access URL | ||
|
||
``` | ||
http://localhost:8080/ | ||
``` | ||
|
||
Enter username/password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
upstream appservice { | ||
server appservice:30301; | ||
} | ||
|
||
server { | ||
listen 8080; | ||
|
||
auth_basic "Basic auth"; | ||
auth_basic_user_file /etc/apache2/.htpasswd; | ||
|
||
location / { | ||
proxy_pass http://appservice; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: "3" | ||
|
||
services: | ||
appservice: | ||
image: ledongthuc/awssecretsmanagerui:latest | ||
proxy: | ||
container_name: reverse | ||
hostname: reverse | ||
image: nginx | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- ./custom.conf:/etc/nginx/conf.d/default.conf | ||
- ./.htpasswd:/etc/apache2/.htpasswd | ||
depends_on: | ||
- appservice |