Answer the question
In order to leave comments, you need to log in
Have you set up static caching in RAM correctly?
I decided to unload the HDD a little, I did it like this:
File is given from the subdomain.
content.site.conf:
server {
listen content.site:80;
server_name content.site;
location ~* ^.+\.(jpg|jpeg|gif|png|js|css|swf|docx|doc) {
proxy_cache static_cache;
proxy_cache_key "$host$request_uri $cookie_user";
proxy_cache_valid 200 60m;
proxy_set_header Host cache.$host;
proxy_pass http://127.0.0.1;
}
}
server {
listen 127.0.0.1:80;
server_name cache.site;
location ~* ^.+\.(jpg|jpeg|gif|png|js|css|swf|docx|doc)$ {
allow 127.0.0.1;
deny all;
root /var/www/content;
}
}
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_cache:128m inactive=60m max_size=500m;
tmpfs /var/cache/nginx tmpfs noatime,nodiratime,nodev,nosuid,uid=33,gid=33,mode=0700,size=512M 0 0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question