24 lines
666 B
ApacheConf
24 lines
666 B
ApacheConf
# HTTP 配置,监听端口 80,并重定向到 HTTPS
|
||
<VirtualHost *:80>
|
||
ServerName demo.chenx221.cyou
|
||
|
||
RewriteEngine On
|
||
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
|
||
</VirtualHost>
|
||
|
||
# HTTPS 配置,监听端口 443
|
||
<VirtualHost *:443>
|
||
ServerName demo.chenx221.cyou
|
||
|
||
DocumentRoot "/var/www/html/web"
|
||
<Directory "/var/www/html/web">
|
||
Options +Indexes +Includes +FollowSymLinks +MultiViews
|
||
AllowOverride All
|
||
Require all granted
|
||
LimitRequestBody 2147483648
|
||
</Directory>
|
||
|
||
SSLEngine on
|
||
SSLCertificateFile "/etc/ssl/fullchain1.pem"
|
||
SSLCertificateKeyFile "/etc/ssl/privkey1.pem"
|
||
</VirtualHost> |