Skip to content

Commit 50fc159

Browse files
committed
adding keepalives to upstream connection
1 parent 486f70d commit 50fc159

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ Notable differences from the official [nginx container][]
8888
[nginx container]: https://hub.docker.com/_/nginx
8989
[gomplate]: https://docs.gomplate.ca/
9090
[uwsgi]: https://uwsgi-docs.readthedocs.io/en/latest/
91-
[nginx status]: https://nginx.org/en/docs/http/ngx_http_stub_status_module.html
91+
[nginx status]: https://nginx.org/en/docs/http/ngx_http_stub_status_module.html

src/etc/nginx/conf.d/default.conf.template

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Default configuration returns 400 in order to deny any request with an
1+
# Default configuration returns 400 in order to deny any request with an
22
# unrecognized host header (server_name.)
33
{{ if (ne .Env.SERVER_NAME "_") }}
44
server {
@@ -10,6 +10,8 @@ server {
1010

1111
upstream app {
1212
server {{ .Env.UPSTREAM_SERVER }};
13+
14+
keepalive 8; # The maximum number of idle keepalive connections to upstream servers.
1315
}
1416

1517
server {
@@ -21,7 +23,10 @@ server {
2123
add_header X-Frame-Options "SAMEORIGIN";
2224
add_header X-XSS-Protection "1; mode=block";
2325
add_header X-Content-Type-Options "nosniff";
24-
26+
27+
proxy_http_version 1.1;
28+
proxy_set_header "Connection" "";
29+
2530
location / {
2631
{{ if (eq .Env.PROXY_UWSGI "1") }}
2732
include /etc/nginx/includes/uwsgi.conf;

0 commit comments

Comments
 (0)