File tree 1 file changed +51
-4
lines changed
1 file changed +51
-4
lines changed Original file line number Diff line number Diff line change 1
- Docker-compose-Nginx-Reverse-Proxy-II
2
- ===================================
1
+ Original:
2
+ ---------
3
+ [ Docker compose : Nginx reverse proxy with multiple containers] ( http://www.bogotobogo.com/DevOps/Docker/Docker-Compose-Nginx-Reverse-Proxy-Multiple-Containers.php )
4
+
5
+ Consolidated to a single docker-compose.yml file
3
6
4
- Tutorial
7
+ Launching
5
8
---------
9
+ ** Build:**
10
+
11
+ docker compose up -d
12
+
13
+ ** Check if all containers are running:**
14
+
15
+ root@Jakub-T480s:/home/jakub/dockercompose-nginx-reverse-proxy# docker ps
16
+ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
17
+ d9384cafd95b nginx:1.12 "nginx -g 'daemon of…" 8 minutes ago Up 8 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp proxy
18
+ f475ce1e8750 nginx:1.12 "nginx -g 'daemon of…" 8 minutes ago Up 8 minutes 80/tcp site2
19
+ 024e38bfd73d nginx:1.12 "nginx -g 'daemon of…" 8 minutes ago Up 8 minutes 80/tcp site1
20
+
21
+ ** Edit /etc/hosts**
22
+
23
+ 172.18.230.198 mly0037_1.eb212.local
24
+ 172.18.230.198 mly0037_2.eb212.local
25
+ or
26
+
27
+ 127.0.0.1 mly0037_1.eb212.local
28
+ 122.0.0.1 mly0037_2.eb212.local
29
+
30
+ ** Test if reverse proxy is working correctly:**
31
+ site1:
6
32
7
- [ Docker compose : Nginx reverse proxy with multiple containers] ( http://www.bogotobogo.com/DevOps/Docker/Docker-Compose-Nginx-Reverse-Proxy-Multiple-Containers.php )
33
+ root@Jakub-T480s:/home/jakub/dockercompose-nginx-reverse-proxy# curl mly0037_1.eb212.local
34
+ <!DOCTYPE html>
35
+ <html>
36
+ <head>
37
+ <title>STRANKA 1</title>
38
+ </head>
39
+ <body>
40
+ <h1>mly0037_1.eb212.local</h1>
41
+ </body>
42
+ </html>
43
+ site2:
44
+
45
+ root@Jakub-T480s:/home/jakub/dockercompose-nginx-reverse-proxy# curl mly0037_2.eb212.local
46
+ <!DOCTYPE html>
47
+ <html>
48
+ <head>
49
+ <title>STRANKA 2</title>
50
+ </head>
51
+ <body>
52
+ <h1>mly0037_2.eb212.local</h1>
53
+ </body>
54
+ </html>
8
55
You can’t perform that action at this time.
0 commit comments