Skip to content

Commit 53b27de

Browse files
feat(nginx): route portfolio API through shared proxy-network
Two containers can't both bind :80/:443, so the portfolio API's own nginx/certbot stack is being retired. This nginx now joins the external proxy-network and routes mcp.victorlisbronzo.me to the portfolio's api container, reusing the existing PORTFOLIO_DOMAIN envsubst variable that was already wired in but unused. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent fe3d3c6 commit 53b27de

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ services:
104104
- "host.docker.internal:host-gateway"
105105
networks:
106106
- local-network
107+
- proxy-network
107108
depends_on:
108109
- n8n
109110
- evolution
@@ -126,3 +127,5 @@ volumes:
126127
networks:
127128
local-network:
128129
driver: bridge
130+
proxy-network:
131+
external: true

nginx/domains.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
N8N_DOMAIN=seuservidor.com
22
EVO_DOMAIN=seuservidor.com
33
PORTAINER_DOMAIN=seuservidor.com
4+
PORTFOLIO_DOMAIN=seuservidor.com
45

56
CERT_DOMAIN=yoursever.com

nginx/nginx.conf.template

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,43 @@ http {
119119
}
120120
}
121121

122+
### Portfolio API (MCP) Nginx Configuration ###
123+
124+
server {
125+
listen 80;
126+
server_name ${PORTFOLIO_DOMAIN};
127+
128+
location /.well-known/acme-challenge/ {
129+
root /var/www/certbot;
130+
}
131+
132+
location / {
133+
return 301 https://$host$request_uri;
134+
}
135+
}
136+
137+
server {
138+
listen 443 ssl;
139+
server_name ${PORTFOLIO_DOMAIN};
140+
141+
ssl_certificate /etc/letsencrypt/live/${PORTFOLIO_DOMAIN}/fullchain.pem;
142+
ssl_certificate_key /etc/letsencrypt/live/${PORTFOLIO_DOMAIN}/privkey.pem;
143+
144+
location / {
145+
proxy_pass http://api:3001;
146+
proxy_http_version 1.1;
147+
proxy_set_header Connection '';
148+
proxy_set_header Host $host;
149+
proxy_set_header X-Real-IP $remote_addr;
150+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
151+
proxy_set_header X-Forwarded-Proto $scheme;
152+
153+
proxy_buffering off;
154+
proxy_cache off;
155+
chunked_transfer_encoding off;
156+
proxy_read_timeout 86400s;
157+
proxy_send_timeout 86400s;
158+
}
159+
}
122160

123161
}

0 commit comments

Comments
 (0)