Sorry for long reply, perhaps missed notification.
I debugged deeper. The problem actually is why Civetweb waiting 30 seconds before send TCP FIN.
Compared with nginx:
on setting 80r, basically 302 is sent asking the client to redirect to the ssl port. Was an ssl certificate set correctly with the ssl_certificate option?
Yes. Look at total time.
[k0ste@WorkStation ~]$ time curl -vL http://s3.e2e4.ru/
* Trying 193.150.124.9...
* TCP_NODELAY set
* Connected to s3.e2e4.ru (193.150.124.9) port 80 (#0)
> GET / HTTP/1.1
> Host: s3.e2e4.ru
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 302 Found
< Location: https://s3.e2e4.ru:443/
* no chunk, no close, no size. Assume close to signal end
<
* Closing connection 0
* Issue another request to this URL: 'https://s3.e2e4.ru:443/'
* Trying 193.150.124.9...
* TCP_NODELAY set
* Connected to s3.e2e4.ru (193.150.124.9) port 443 (#1)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.e2e4.ru
* start date: Sep 11 00:00:00 2017 GMT
* expire date: Sep 10 23:59:59 2020 GMT
* subjectAltName: host "s3.e2e4.ru" matched cert's "*.e2e4.ru"
* issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA
* SSL certificate verify ok.
> GET / HTTP/1.1
> Host: s3.e2e4.ru
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 200 OK
< x-amz-request-id: tx00000000000000002175e-005bb2eff1-d6b15d3-default
< Content-Type: application/xml
< Content-Length: 214
< Date: Tue, 02 Oct 2018 04:11:29 GMT
<
* Connection #1 to host s3.e2e4.ru left intact
<?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult>
real 0m30.138s
user 0m0.020s
sys 0m0.019s