infra-modumfiscal/dev/nginx/conf.d/modumfiscal.conf

61 lines
1.5 KiB
Plaintext

upstream core_api {
server modumfiscal-api.app-net:8090;
}
upstream frontend {
server modumfiscal-web.app-net:80;
}
upstream portal {
server app_portal-modumfiscal-web.app-net:3000;
}
server {
listen 80;
listen [::]:80;
server_name sistema.modumfiscal.com.br;
location /api/ {
proxy_pass http://core_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;
}
location / {
proxy_pass http://frontend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_intercept_errors on;
error_page 404 = @fallback;
}
location @fallback {
proxy_pass http://frontend;
proxy_http_version 1.1;
proxy_set_header Host $host;
rewrite ^ /index.html break;
}
}
server {
listen 80;
listen [::]:80;
server_name portal-sistema.modumfiscal.com.br;
location / {
proxy_pass http://portal;
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_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;
}
}