Created
January 19, 2019 07:47
-
-
Save pandanote-info/a1e346e89ba5192c91efaea19546be62 to your computer and use it in GitHub Desktop.
Let's encryptから証明書を取得または更新するためのApache httpdの設定例。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
ServerAdmin panda@example.com | |
DocumentRoot /var/www/html | |
ServerName example.com | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# HTTP/1.1 is only available for this site. | |
RewriteCond %{THE_REQUEST} HTTP/(1\.0|0\.[0-9])$ | |
RewriteRule ^(.*)$ - [R=403,L] | |
# Redirection to force HTTPS protocol. | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L] | |
</IfModule> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment