gistfile1.txt
· 1.3 KiB · Text
原始文件
Protocols h2 h2c http/1.1
<VirtualHost *:80>
<Directory /var/www/html/website/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ServerAdmin email@address.tld
ServerName domain.tld
DocumentRoot /var/www/html/website
ErrorLog ${APACHE_LOG_DIR}/website.error.log
RewriteEngine On
RewriteCond %{SERVER_NAME} =domain.tld
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
<Directory /var/www/html/website/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
ServerAdmin email@address.tld
ServerName domain.tld
DocumentRoot /var/www/html/website
ErrorLog ${APACHE_LOG_DIR}/website.error.log
RewriteEngine On
RewriteCond %{SERVER_NAME} =domain.tld
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteCond %{THE_REQUEST} !HTTP/1.1$
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
SSLCertificateFile /etc/letsencrypt/live/domain-tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
| 1 | Protocols h2 h2c http/1.1 |
| 2 | |
| 3 | <VirtualHost *:80> |
| 4 | <Directory /var/www/html/website/> |
| 5 | Options Indexes FollowSymLinks MultiViews |
| 6 | AllowOverride All |
| 7 | Order allow,deny |
| 8 | allow from all |
| 9 | </Directory> |
| 10 | |
| 11 | ServerAdmin email@address.tld |
| 12 | ServerName domain.tld |
| 13 | DocumentRoot /var/www/html/website |
| 14 | |
| 15 | ErrorLog ${APACHE_LOG_DIR}/website.error.log |
| 16 | |
| 17 | RewriteEngine On |
| 18 | RewriteCond %{SERVER_NAME} =domain.tld |
| 19 | RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] |
| 20 | </VirtualHost> |
| 21 | |
| 22 | <VirtualHost *:443> |
| 23 | <Directory /var/www/html/website/> |
| 24 | Options Indexes FollowSymLinks MultiViews |
| 25 | AllowOverride All |
| 26 | Order allow,deny |
| 27 | allow from all |
| 28 | </Directory> |
| 29 | |
| 30 | # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" |
| 31 | |
| 32 | ServerAdmin email@address.tld |
| 33 | ServerName domain.tld |
| 34 | DocumentRoot /var/www/html/website |
| 35 | |
| 36 | ErrorLog ${APACHE_LOG_DIR}/website.error.log |
| 37 | |
| 38 | RewriteEngine On |
| 39 | RewriteCond %{SERVER_NAME} =domain.tld |
| 40 | RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] |
| 41 | RewriteCond %{THE_REQUEST} !HTTP/1.1$ |
| 42 | RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301] |
| 43 | |
| 44 | SSLCertificateFile /etc/letsencrypt/live/domain-tld/fullchain.pem |
| 45 | SSLCertificateKeyFile /etc/letsencrypt/live/domain.tld/privkey.pem |
| 46 | Include /etc/letsencrypt/options-ssl-apache.conf |
| 47 | </VirtualHost> |