Website config
- Brotli is on.
- Always Use HTTPS is on.
- HTTP Strict Transport Security is off.
- SSL/TLS encryption mode is Full (strict).
Access Kumo by proxy
SSL/TLS
There are two ways to get certificates: Let’s Encrypt or CloudFlare Origin. I prefer CloudFlare Origin to Let’s Encrypt.
Let’s Encrypt CA certificates
Refer to this document, Certbot needs webroot plugin to get certificates when using proxy.
certbot certonly --webroot -w /var/www/example -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net
CloudFlare Origin CA certificates
Refer to this document, get the certificate and the key from Cloudflare. I choose ECC type and 15-year validity.
Apache remote IP
Refer to this document, Apache needs module mod_remoteip to get original visitor IPs.
# /etc/apache2/conf-available/remoteip.conf
RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxyList /etc/apache2/trusted-proxies-cfv4.lst
RemoteIPTrustedProxyList /etc/apache2/trusted-proxies-cfv6.lst
# /etc/apache2/apache2.conf
LogFormat "%v:%p %a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" \"%{remoteip-proxy-ip-list}n\"" proxy_combined
# /etc/apache2/sites-available/site.conf
RemoteIPHeader CF-Connecting-IP
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log proxy_combined
The script is used to get Cloudflare IPs for RemoteIPTrustedProxyList.
#!/bin/bash
curl https://www.cloudflare.com/ips-v4 > /etc/apache2/trusted-proxies-cfv4.lst
curl https://www.cloudflare.com/ips-v6 > /etc/apache2/trusted-proxies-cfv6.lst