Skip to content

Commit

Permalink
Merge pull request alibaba#97 from alibaba/tengine-ingress-3.1.0
Browse files Browse the repository at this point in the history
Fix duplicate location robots.txt and unknown "https_use_timing" for static configuration
  • Loading branch information
lianglli authored Oct 24, 2023
2 parents 4c10415 + bdf0498 commit 89470a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion rootfs/etc/nginx/apps/ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ if ($https_redirect_mode = '1_https') {
}

add_header "Strict-Transport-Security" $https_use_hsts;
add_header "Timing-Allow-Origin" $https_use_timing;

if ($https_redirect_mode = '1_http') {
set $log_host "http301https.tengine.com";
Expand Down
8 changes: 4 additions & 4 deletions rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ http {
client_body_buffer_size {{ $cfg.ClientBodyBufferSize }};
client_body_timeout {{ $cfg.ClientBodyTimeout }}s;

http2_max_field_size {{ $cfg.HTTP2MaxFieldSize }};
http2_max_header_size {{ $cfg.HTTP2MaxHeaderSize }};
http2_max_requests {{ $cfg.HTTP2MaxRequests }};
http2_max_concurrent_streams {{ $cfg.HTTP2MaxConcurrentStreams }};

types_hash_max_size 2048;
Expand Down Expand Up @@ -918,6 +915,8 @@ stream {
root /etc/nginx/htdocs;
}



{{ if not (empty $server.AuthTLSError) }}
# {{ $server.AuthTLSError }}
return 403;
Expand Down Expand Up @@ -1474,6 +1473,7 @@ stream {
{{ end }}
}

{{ if eq $path "/" }}
location /robots.txt {
header_filter_by_lua_block {
lua_ingress.header()
Expand All @@ -1490,7 +1490,6 @@ stream {
set $log_host "robots.tengine.com";
proxy_set_header Host $http_host;
proxy_set_header X-Request-From {{ $all.Cfg.TengineIngressAppName }};
add_header Timing-Allow-Origin $https_use_timing;

{{ if $all.Cfg.TengineReload }}
{{ if not $location.DisableRobots }}
Expand Down Expand Up @@ -1519,6 +1518,7 @@ stream {
}
{{ end }}
{{ end }}
{{ end }}

{{ if eq $server.Hostname "_" }}
# health checks in cloud providers require the use of port {{ $all.ListenPorts.HTTP }}
Expand Down

0 comments on commit 89470a6

Please sign in to comment.