feat: nginx reverse proxy api in frontend container
This commit is contained in:
1 parent
f2420d159e
commit
55b4dd52ff
2 files changed
+33
No files matched your search
@@ -43,6 +43,9 @@ services:
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./frontend:/usr/share/nginx/html:ro
|
||||
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
depends_on:
|
||||
- api
|
||||
networks:
|
||||
- default
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index wonderloo.html;
|
||||
|
||||
# Frontend estático
|
||||
location = / {
|
||||
try_files /wonderloo.html =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /wonderloo.html =404;
|
||||
}
|
||||
|
||||
# Reverse proxy al API
|
||||
location /api/ {
|
||||
proxy_pass http://api:3001/api/;
|
||||
proxy_http_version 1.1;
|
||||
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;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# Upload size para firmas base64
|
||||
client_max_body_size 2M;
|
||||
}
|
||||
Reference in new issue
Block a user