---------- Forwarded message ----------
Date: Fri, May 16, 2014 at 7:31 AM
Subject: Re: New order N. 00000053 (Sorin Razvan Esanu)
Hello,
I've implemented this, but it does not seem to be working at all (no
caching, 0 performance improvement). Here is my config (joomla has SEF
enabled):
user nobody;
worker_processes 24;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
worker_rlimit_nofile 20000;
events {
worker_connections 19200;
}
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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 10;
gzip on;
#custom - caching
proxy_cache_path /var/www/cache levels=1:2 keys_zone=my-cache:8m
max_size=1g inactive=600m;
proxy_temp_path /var/www/cache/tmp;
server {
root /home/www/mysite.com;
index index.php index.html index.htm;
server_name www.mysitecom;
location ~* \.(js|css|jpg|jpeg|gif|png|svg|ico|pdf|html|htm)$ { }
location ~* {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:80;
# Define which cache to use
proxy_cache my-cache;
# # Define which responses to cache and for how long
proxy_cache_valid 200 302 60m;
proxy_cache_valid 404 5m;
#
# # Don't cache if our headers (or cookie) are present
proxy_no_cache $upstream_http_x_dont_cache_me $cookie_jnocache;
proxy_cache_bypass $upstream_http_x_dont_cache_me $cookie_jnocache;
#
# # Ignore the standard no-cache headers - these will still be sent to the
browser
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
#
# # Don't send our custom header to the browser
proxy_hide_header X-Dont-Cache-Me;
#
# # This next line is important if we're planning on caching for more than
one site on the server
proxy_cache_key "$scheme$host$request_uri";
}
location ~ /\.ht {
deny all;
}
}
}
---------- Forwarded message ----------
Date: Fri, May 16, 2014 at 7:41 AM
Also, something is not right, as I do not see some of the headers you say
in your instructions pages. All the requests I see in nginx access log I
also see in apache access log.
I am running apache 2.2 and latest nginx (I believe is 1.6.0).
Looking at static content on your site (CSS/JS etc), the response headers
would suggest that we're either talking to apache directly or requests for
those are also being proxied (the latters not such an issue if we can get
them caching)
With the config you've got, it looks like things should be caching, do you
get any results if you run the following from the shell?
find -type f /var/www/cache
If no files, then nothing's being written to cache whatso-ever. Are there
any errors logged in NGinx's logs that might suggest why?
Your settings look correct for the plugin (in fact they almost exactly
mirror the settings I use on my site), I would hazard a guess that
something's preventing headers from being sent (output already started
maybe?).
Do you see anything if you turn error reporting on?
I'm basing that on the absence of the cookie though as the line
'proxy_hide_header X-Dont-Cache-Me;' in NGinx's configuration will ensure that we don't see
the header.
Activity
2014-05-16 13:35:32
Date: Fri, May 16, 2014 at 7:31 AM
Subject: Re: New order N. 00000053 (Sorin Razvan Esanu)
Hello,
I've implemented this, but it does not seem to be working at all (no
caching, 0 performance improvement). Here is my config (joomla has SEF
enabled):
Please advise.
Thanks!
2014-05-16 13:35:50
2014-05-16 13:35:50
2014-05-16 13:35:50
2014-05-16 13:36:00
Date: Fri, May 16, 2014 at 7:41 AM
Also, something is not right, as I do not see some of the headers you say
in your instructions pages. All the requests I see in nginx access log I
also see in apache access log.
I am running apache 2.2 and latest nginx (I believe is 1.6.0).
Thank you again!
2014-11-08 19:15:26
---------- Forwarded message ----------
From: "Ben Tasker"
Date: 16 May 2014 12:53
Hi,
Looking at static content on your site (CSS/JS etc), the response headers
would suggest that we're either talking to apache directly or requests for
those are also being proxied (the latters not such an issue if we can get
them caching)
With the config you've got, it looks like things should be caching, do you
get any results if you run the following from the shell?
If no files, then nothing's being written to cache whatso-ever. Are there
any errors logged in NGinx's logs that might suggest why?
Your settings look correct for the plugin (in fact they almost exactly
mirror the settings I use on my site), I would hazard a guess that
something's preventing headers from being sent (output already started
maybe?).
Do you see anything if you turn error reporting on?
I'm basing that on the absence of the cookie though as the line
'proxy_hide_header X-Dont-Cache-Me;' in NGinx's configuration will ensure that we don't see
the header.
and see whether Apache is setting anything.
Also, if you add
To your NGinx config just after the proxy_cache_key declaration. You should
get a header saying whether the cache was bypassed for some reason.
--
Ben Tasker
http://www.bentasker.co.uk
2014-11-08 19:15:27
2014-11-08 19:15:27
2014-11-08 19:15:27
2014-11-08 19:15:28
2014-11-08 19:15:28
2014-11-08 19:15:28
2014-11-09 00:54:40
2014-11-09 00:54:45
2014-11-09 00:54:56
2014-11-09 00:55:00
2014-11-09 00:55:09
2014-11-09 00:55:13
2014-11-09 01:02:30
2014-11-09 01:02:30
2014-11-09 01:02:30
2014-11-09 01:02:35