I have enabled gzip on server (nginx), when I test it with: curl -H “Accept-Encoding: gzip” -I domain.com/test.html - it works.
Grav has enabled gzip:
grep -ir gzip config/
config/system.yaml: gzip: false
config/system.yaml: allow_webserver_gzip: true
and when I test with curl, I’m getting:
curl -H “Accept-Encoding: gzip” -I --resolve ‘some_domain.com:80:serverip’ http://some_domain.com
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Tue, 20 Feb 2018 19:16:22 GMT
Content-Type: text/html;charset=UTF-8
Content-Length: 19333
Connection: keep-alive
Set-Cookie: grav-site-…=…; expires=Tue, 20-Feb-2018 19:46:22 GMT; Max-Age=1800; path=/; domain=some_domain.com
Pragma: no-cache
Set-Cookie: grav-site-…=…; expires=Tue, 20-Feb-2018 19:46:22 GMT; Max-Age=1800; path=/; domain=some_domain.com; HttpOnly
Cache-Control: max-age=604800
Expires: Tue, 27 Feb 2018 19:16:22 GMT
Content-Encoding: identity
What am I missing?
You’ll probably want to post the relevant nginx conf, sounds like that’s where the actual issue would be.
I tried to post link to some pastebin with nginx conf and got my account on hold. Should I just paste it here?
Yea that should be fine. Just wrap your pasted conf file in between three back-ticks like this:
``` pasted conf file here ```
server_name somedomain.com www.somedomain.com somedomain.pl www.somedomain.pl;
listen 127.0.0.1;
root /home/somedomain/public_html;
index index.html index.htm index.php;
access_log /var/log/virtualmin/somedomain.com_access_log;
error_log /var/log/virtualmin/somedomain.com_error_log;
# gzip on;
# gzip_min_length 1000;
# gzip_proxied expired no-cache no-store private auth;
# gzip_types text/plain application/xml;
gzip on;
# gzip_http_version 1.1;
# gzip_vary on;
# gzip_min_length 1024;
# gzip_proxied expired no-cache no-store private auth;
# gzip_types text/plain text/css text/html text/xml text/javascript application/x-javascript application/xml;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 5;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;
# gzip_disable "MSIE [1-6]\.";
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 14d;
access_log off;
add_header Pragma public;
add_header Cache-Control "public, max-age=1209600, s-maxage=1209600";
add_header X-Asset "yes";
}
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/somedomain/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/somedomain/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/php-nginx/150542276614641.sock/socket;
}
location / {
try_files $uri $uri/ /index.php?_url=$uri;
}
## Begin - Security
# deny all direct access for these folders
location ~* /(.git|cache|bin|logs|backups|tests)/.*$ { return 403; }
# deny running scripts inside core system folders
location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny running scripts inside user folder
location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny access to specific files in the root folder
location ~ /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; }
## End - Security
listen 127.0.0.1:443 ssl;
ssl_certificate /home/somedomain/ssl.cert;
ssl_certificate_key /home/somedomain/ssl.key;
}```
Any idea what can I do or check?