• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
Thank you, very much for great support. I get it here by your amazing tutorial and changing the input syntax a little, I didn't write the items in a special way: How to compile NGINX with additional modules ( pagespeed / cache_purge / headers-more / and others )
. What I now discovered, without any setting with BROTLI together with Pagespeed. The test-time by Qualys (ssllabs.com) is 69 seconds, yesterday and all last weeks OVER (!!!) 2 minutes with long cipherlist. So this is the co-influence right from using Pagespeed+Brotli.
 
brotli_types text/html
Hi @UFHH01
I followed your instruction but get the warning "duplicate entryMIME type text/html": (But in the last box is my gzip.conf yesterday deleted to avoid double configurations from /etc/nginx/conf.d. I used it the last 9 months for Apache+Nginx as reverse proxy and since around one week for ONLY Nginx configurations. There you left text/html.
Shall I ignore the warning or leave text/html out and risk less brotli functionality.

I found no hints on internet to this special part of brotli settings.
Code:
root@server:~# nginx -t
nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/nginx.conf:45
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Here is the whole /etc/nginx/nginx.conf
Code:
#user  nginx;
worker_processes  1;

#error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

#pid        /var/run/nginx.pid;

include /etc/nginx/modules.conf.d/*.conf;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    #tcp_nodelay        on;

    #gzip  on;
    #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    server_tokens off;

    include /etc/nginx/conf.d/*.conf;

    # BEGIN Google brotli - definitions, tuned by UFHH01
    brotli on;
    brotli_static on;
    brotli_types text/html text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/vnd.microsoft.icon image/bmp image/svg+xml;
    brotli_comp_level 8;
    # END Google brotli - definitions, tuned by UFHH01

    # BEGIN gzip - Definitions, tuned by UFHH01
    gzip_static on;
    gzip on;
    gzip_proxied any;
    gzip_http_version 1.1;
    gzip_min_length 100;
    gzip_vary on;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_types audio/wav audio/ogg font/opentype text/css text/javascript text/plain text/richtext text/x-component text/x-js text/xml text/xsd text/xsl font/opentypeapplication/font-woff application/atom+xml application/font-woff2 application/javascript application/java application/json application/msword application/pdf application/xhtml+xml application/xml application/xml+rss image/bmp image/tiff image/svg+xml image/webp image/x-icon application/vnd.ms-access application/vnd.ms-excel application/vnd.ms-fontobject application/vnd.ms-opentype application/vnd.ms-powerpoint application/vnd.ms-project application/vnd.ms-write application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text application/x-font-ttf application/x-font-opentype application/x-font-otf application/x-javascript application/x-msdownload application/x-shockwave-flash application/x-web-app-manifest+json;
    # Disable gzip for certain browsers.
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    # END gzip - Definitions, tuned by UFHH01

}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;

older /etc/nginx/conf.d/gzip.conf
Code:
gzip on;
gzip_disable "MSIE [1-6]\\.(?!.*SV1)";
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml text/javascript image/x-icon image/bmp image/svg+xml application/javascript application/js application/xhtml+xml application/rss+xml application/x-font-ttf application/vnd.ms-fontobject font/opentype font/ttf font/eot font/otf image/jpg image/jpeg image/png image/gif application/json;
gzip_vary on;

Greets
 
Hi Dukemaster,

... and again, pls. note the difference between WARNINGS/NOTICES and ERRORS, pls.!


Yes, you might get warnings as described, because with my suggestion, you use "brotli" AND "gzip" compressions for the MIME type "text/html".

If you don't like the idea, if the WARNING disturbs you in whatever way, or if you think, that you would like to use only "brotli" OR "gzip" compression for this MIME type, pls. feel free to leave out this option at the "brotli" - modifications OR the "gzip" - modifications. ;) Simple... isn't it? ^^
 
Hi @UFHH01 ,
no such things disturbing me in no way. Only the possibility to have less compression or risking troubles by ignoring the warning are interesting for me.
I already read that pagespeed configuration mistakes could end in less functionality and even harm the whole webserver configuration. This is no place for playing like somewhere else on webserver

greets
 
Back
Top