-
-
Save oschaaf/5c4504877db5a132e531 to your computer and use it in GitHub Desktop.
nginx + fastcgi_cache + ngx_pagespeed
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
http { | |
include mime.types; | |
default_type application/octet-stream; | |
pagespeed FileCachePath /tmp/npstmp/; | |
pagespeed on; # off to test ngx_pagespeed disabled | |
fastcgi_cache_path /tmp/nginxcache levels=1:2 keys_zone=myzone:1m inactive=60m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
server { | |
listen 80; | |
server_name localhost; | |
root html; | |
location ~ \.php$ { | |
fastcgi_param SCRIPT_FILENAME $request_filename; | |
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_pass 127.0.0.1:9000; | |
fastcgi_cache myzone; | |
fastcgi_cache_valid any 1m; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment