-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flag --client_body_timeout (#765)
- Loading branch information
Showing
4 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
start_esp/test/testdata/expected_client_body_timeout_nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Auto-generated by start_esp | ||
# Copyright (C) Extensible Service Proxy Authors | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# 1. Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# 2. Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
# SUCH DAMAGE. | ||
|
||
daemon off; | ||
|
||
user nginx nginx; | ||
|
||
pid ./start_esp/test/pid_file; | ||
|
||
# Worker/connection processing limits | ||
worker_processes 1; | ||
worker_rlimit_nofile 10240; | ||
events { worker_connections 10240; } | ||
|
||
# Logging to stderr enables better integration with Docker and GKE/Kubernetes. | ||
error_log stderr warn; | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
include /etc/nginx/conf/*.conf; | ||
server_tokens off; | ||
client_max_body_size 32m; | ||
client_body_buffer_size 128k; | ||
client_body_timeout 86600s; | ||
|
||
# HTTP subrequests | ||
endpoints_resolver 8.8.8.8; | ||
endpoints_certificates /etc/nginx/trusted-ca-certificates.crt; | ||
|
||
upstream app_server0 { | ||
server 127.0.0.1:8081; | ||
keepalive 128; | ||
} | ||
|
||
set_real_ip_from 0.0.0.0/0; | ||
set_real_ip_from 0::/0; | ||
real_ip_header X-Forwarded-For; | ||
real_ip_recursive on; | ||
|
||
|
||
server { | ||
server_name ""; | ||
resolver 8.8.8.8; | ||
|
||
|
||
listen 8080 backlog=16384; | ||
|
||
access_log /dev/stdout; | ||
|
||
|
||
|
||
|
||
location / { | ||
# Begin Endpoints v2 Support | ||
endpoints { | ||
on; | ||
server_config /etc/nginx/server_config.pb.txt; | ||
google_authentication_secret key; | ||
metadata_server http://169.254.169.254; | ||
} | ||
# End Endpoints v2 Support | ||
|
||
|
||
|
||
proxy_pass http://app_server0; | ||
proxy_redirect off; | ||
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-Host $server_name; | ||
proxy_set_header X-Google-Real-IP $remote_addr; | ||
|
||
# Enable the upstream persistent connection | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection ""; | ||
|
||
# 86400 seconds (24 hours) is the maximum a server is allowed. | ||
proxy_send_timeout 86400s; | ||
proxy_read_timeout 86400s; | ||
} | ||
|
||
include /var/lib/nginx/extra/*.conf; | ||
} | ||
|
||
server { | ||
# expose /nginx_status and /endpoints_status but on a different port to | ||
# avoid external visibility / conflicts with the app. | ||
listen 8090; | ||
location /nginx_status { | ||
stub_status on; | ||
access_log off; | ||
} | ||
location /endpoints_status { | ||
endpoints_status; | ||
access_log off; | ||
} | ||
location /healthz { | ||
return 200; | ||
access_log off; | ||
} | ||
location / { | ||
root /dev/null; | ||
} | ||
} | ||
} |