Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate location robots.txt and unknown "https_use_timing" for static configuration #97

Merged
merged 6 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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