refactor: consolidate public-web port to 8080 and add API proxy configuration
Remove backend port exposure and change public-web from port 8082 to 8080. Add backend dependency to public-web service. Remove public-web dependency from nginx service. Add /api/ location block to public-web nginx config with proxy_pass to backend:8080 and proxy headers for Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto.
This commit is contained in:
@@ -23,8 +23,6 @@ services:
|
||||
- .env
|
||||
depends_on:
|
||||
- postgres
|
||||
ports:
|
||||
- "8080:8080"
|
||||
networks:
|
||||
control:
|
||||
aliases:
|
||||
@@ -48,8 +46,10 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: public-web/Dockerfile
|
||||
depends_on:
|
||||
- backend
|
||||
ports:
|
||||
- "8082:80"
|
||||
- "8080:80"
|
||||
networks:
|
||||
- control
|
||||
|
||||
@@ -58,7 +58,6 @@ services:
|
||||
depends_on:
|
||||
- backend
|
||||
- admin-web
|
||||
- public-web
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
|
||||
@@ -4,6 +4,14 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://backend:8080;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user