-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.conf
44 lines (34 loc) · 1.3 KB
/
default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
log_format gce_proxy '$remote_addr [$time_local] "$request" '
'$status $bytes_sent "$http_referer" "$http_x_forwarded_for" '
'resp_time:$request_time upstream_resp_time:$upstream_response_time '
'cloud_trace_id:"$http_x_cloud_trace_context" '
'upstream_request_id:"$upstream_http_x_request_id"';
server {
listen 80;
# Tune nginx keepalives to work with the GCP HTTP(S) Load Balancer:
keepalive_timeout 650;
keepalive_requests 100000;
location ~ /health-check {
proxy_pass http://127.0.0.1:8080;
access_log off;
}
location /nginx_status {
stub_status on;
access_log off;
}
location / {
if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_connect_timeout 15;
proxy_send_timeout 120;
proxy_read_timeout 1w;
access_log /var/log/nginx/access.log gce_proxy;
}
}