0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Rocky Linux 9】14.Brotli設定(Apache)

Posted at

Brotli設定

インターネット通信を新しい圧縮アルゴリズム「Brotli」にて圧縮する

プラグイン読み込み

/etc/httpd/conf.modules.d/00-brotli.conf
LoadModule brotli_module modules/mod_brotli.so

バーチャルホスト設定

/etc/httpd/conf.d/virtualhost.example.com.conf
<VirtualHost *:80>
    ServerName      example.com
    DocumentRoot    /var/www/example.com
    ErrorLog        logs/example.com/error_log
    CustomLog       logs/example.com/access_log combined env=!nolog
</VirtualHost>

<VirtualHost *:443>
    ServerName      example.com
    DocumentRoot    /var/www/example.com
    ErrorLog        logs/example.com/ssl_error_log
    CustomLog       logs/example.com/ssl_access_log combined env=!nolog
    Protocols       h2 http/1.1

    # Brotli settings
    SetOutputFilter BROTLI_COMPRESS
    SetEnvIfNoCase  Requst_URI \.(bmp|gif|htc|ico|jpe?g|mpe?g|png|swf|woff|ttf)$" no-brotli
    BrotliCompressionQuality 5
    BrotliCompressionWindow 18
    BrotliFilterNote Input instream
    BrotliFilterNote Output outstream
    BrotliFilterNote Ratio ratio
    LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' brotli
    CustomLog "logs/example.com/brotli_log" brotli

    SSLEngine       on
    SSLCertificateFile      /etc/letsencrypt/live/example.com/cert.pem
    SSLCertificateKeyFile   /etc/letsencrypt/live/example.com/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
    Header always set Strict-Transport-Security "max-age=31536000"
</VirtualHost>

Apache再起動

systemctl restart httpd
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?