Skip to content

Commit

Permalink
updated to use resolver - prevents nginx process being killed if unab…
Browse files Browse the repository at this point in the history
…le to resolve downstream proxy host
  • Loading branch information
jeremycook123 committed Sep 22, 2023
1 parent c8e6f63 commit e194b16
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions conf/conf.d/default.conf.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
upstream api-backend {
server ${NGINX_APP_APIHOSTPORT};
keepalive 20;
}

server {
listen 8080;
set $target ${NGINX_APP_APIHOSTPORT};

add_header Cache-Control no-cache;

location / {
Expand All @@ -15,7 +12,10 @@ server {
}

location /api/stocks/csv {
proxy_pass http://api-backend;
resolver ${NGINX_DNS_RESOLVER} valid=300s;
resolver_timeout 10s;

proxy_pass http://$target;
}

error_page 500 502 503 504 /50x.html;
Expand Down

0 comments on commit e194b16

Please sign in to comment.