Skip to content

Commit 386965b

Browse files
Update docker-pad.md
1 parent 284f17d commit 386965b

1 file changed

Lines changed: 37 additions & 36 deletions

File tree

content/en/docs/deployment/docker-deploy/docker-pad.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -244,49 +244,50 @@ This section serves as a reference guide and starting point for configuring a re
244244
This example implementation is provided "as-is" and is not covered under official support. Support requests related to this specific configuration cannot be addressed.
245245
{{% /alert %}}
246246

247-
### Nginx Configuration
247+
### Configuring Nginx
248248

249-
Define services for the app and Nginx reverse proxy.
249+
To configure Nginx, perform the following steps:
250250

251-
```
252-
services:
253-
app:
254-
build: .
255-
ports:
256-
- "127.0.0.1:8080:8080" # Bind only localhost
257-
environment:
258-
- SPRING_PROFILES_ACTIVE=docker
259-
nginx:
260-
image: nginx:alpine
261-
ports:
262-
- "80:80"
263-
volumes:
264-
- ./nginx.conf:/etc/nginx/nginx.conf:ro
265-
depends_on:
266-
- app
267-
```
251+
1. Define services for the app and Nginx reverse proxy:
268252

269-
Run with `docker-compose up --build`.​
253+
```
254+
services:
255+
app:
256+
build: .
257+
ports:
258+
- "127.0.0.1:8080:8080" # Bind only localhost
259+
environment:
260+
- SPRING_PROFILES_ACTIVE=docker
261+
nginx:
262+
image: nginx:alpine
263+
ports:
264+
- "80:80"
265+
volumes:
266+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
267+
depends_on:
268+
- app
269+
```
270270

271-
Create `nginx.conf` for proxying requests to the app.
271+
2. Run the following command: `docker-compose up --build`.​
272+
3. Create the following `nginx.conf` file to proxy requests to the app:
272273

273-
```
274-
events {}
275-
http {
276-
server {
277-
listen 80;
278-
location / {
279-
proxy_pass http://app:8080;
280-
proxy_set_header Host $host;
281-
proxy_set_header X-Real-IP $remote_addr;
282-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
283-
proxy_set_header X-Forwarded-Proto $scheme;
274+
```
275+
events {}
276+
http {
277+
server {
278+
listen 80;
279+
location / {
280+
proxy_pass http://app:8080;
281+
proxy_set_header Host $host;
282+
proxy_set_header X-Real-IP $remote_addr;
283+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
284+
proxy_set_header X-Forwarded-Proto $scheme;
285+
}
286+
}
284287
}
285-
}
286-
}
287-
```
288+
```
288289

289-
This setup exposes only port 80 publicly while proxying to your app on internal port 8080.
290+
This configuration exposes only port 80 publicly while acting as a proxy to your app on the internal port 8080.
290291

291292
### Traefik Configuration
292293

0 commit comments

Comments
 (0)