httpd.conf:
Include conf.d/ports.conf
IncludeOptional sites-enabled/*.conf
conf.d / ports.conf
Listen 80
Listen 443
sites-enabled / example.com.conf
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
Redirect permanent / https://example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/example.com.certificate.pem
SSLCertificateKeyFile /etc/httpd/ssl/example.com.key.key
<Directory /var/www/example.com/public_html/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/example.com.error.log
CustomLog /var/log/httpd/example.com.access.log combined
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/example.com/public_html/$1
DirectoryIndex index.php index.html
</VirtualHost>
... но это просто дает мне "слишком много перенаправлений" для любой комбинации (www, не www, http или https).