Skip to content

Commit c45393c

Browse files
committed
Fix Nginx Proxy mapping and allow Public access to Docker Compose
1 parent 19761bd commit c45393c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docker-compose.prod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ services:
3232
env_file:
3333
- ./deploy/env/backend.env
3434
ports:
35-
- "127.0.0.1:8081:8081"
35+
- "8081:8081"
3636
volumes:
3737
- uploads_data:/app/uploads
3838

3939
frontend:
4040
image: ${REGISTRY:-docker.io}/${IMAGE_NAMESPACE:-hungnq315}/smalltrend-frontend:${IMAGE_TAG:-latest}
4141
restart: unless-stopped
4242
ports:
43-
- "127.0.0.1:3000:80"
43+
- "3000:80"
4444

4545
volumes:
4646
mysql_data:

frontend/nginx/default.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@ server {
88
location / {
99
try_files $uri $uri/ /index.html;
1010
}
11+
12+
location /api/ {
13+
proxy_pass http://backend:8081/api/;
14+
proxy_set_header Host $host;
15+
proxy_set_header X-Real-IP $remote_addr;
16+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
17+
proxy_set_header X-Forwarded-Proto $scheme;
18+
}
1119
}

0 commit comments

Comments
 (0)