fix: nginx dns re-resolve, db healthcheck, explicit bind
This commit is contained in:
@@ -5,8 +5,14 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Docker's embedded DNS. Without re-resolving at request time, nginx caches the
|
||||
# api container's IP from startup and keeps returning 502 ("no live upstreams")
|
||||
# after the api container restarts with a new IP.
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api:3000;
|
||||
set $api_upstream http://api:3000;
|
||||
proxy_pass $api_upstream$request_uri;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
@@ -77633,7 +77633,7 @@ async function bootstrap() {
|
||||
app.useGlobalPipes(new common_1.ValidationPipe({ whitelist: true, transform: true }));
|
||||
app.useGlobalFilters(new prisma_exception_filter_1.PrismaExceptionFilter());
|
||||
app.enableCors();
|
||||
await app.listen(process.env.PORT ?? 3e3);
|
||||
await app.listen(process.env.PORT ?? 3e3, "0.0.0.0");
|
||||
}
|
||||
bootstrap();
|
||||
/*! Bundled license information:
|
||||
|
||||
@@ -10,6 +10,7 @@ async function bootstrap() {
|
||||
app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));
|
||||
app.useGlobalFilters(new PrismaExceptionFilter());
|
||||
app.enableCors();
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
// Bind all interfaces explicitly so the container is reachable from nginx.
|
||||
await app.listen(process.env.PORT ?? 3000, '0.0.0.0');
|
||||
}
|
||||
bootstrap();
|
||||
|
||||
@@ -5,8 +5,14 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Docker's embedded DNS. Without re-resolving at request time, nginx caches the
|
||||
# api container's IP from startup and keeps returning 502 ("no live upstreams")
|
||||
# after the api container restarts with a new IP.
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api:3000;
|
||||
set $api_upstream http://api:3000;
|
||||
proxy_pass $api_upstream$request_uri;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
Reference in New Issue
Block a user