########################################################################################## PLGSCH-3: Headers not being sent ########################################################################################## Issue Type: Bug ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Cannot Reproduce (2014-11-09 01:02:30) Project: Send Custom Headers (PLGSCH) Reported By: btasker Assigned To: btasker Components: - Plugin Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Issue reported by a user, will forward the emails on in a second ----------------------------------------------------------------------------------------- Attachments ============ - fggfhdha.png - hbabjgcc.png - chfbcaij.png ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2014-05-16 13:35:32 mail handler ----------------------------------------------------------------------------------------- ---------- 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): -- BEGIN SNIPPET -- 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; } } } -- END SNIPPET -- Please advise. Thanks! ----------------------------------------------------------------------------------------- 2014-05-16 13:35:50 ----------------------------------------------------------------------------------------- mail handler added 'fggfhdha.png' to Attachments ----------------------------------------------------------------------------------------- 2014-05-16 13:35:50 ----------------------------------------------------------------------------------------- mail handler added 'hbabjgcc.png' to Attachments ----------------------------------------------------------------------------------------- 2014-05-16 13:35:50 ----------------------------------------------------------------------------------------- mail handler added 'chfbcaij.png' to Attachments ----------------------------------------------------------------------------------------- 2014-05-16 13:36:00 mail handler ----------------------------------------------------------------------------------------- ---------- 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). Thank you again! ----------------------------------------------------------------------------------------- 2014-11-08 19:15:26 mail handler ----------------------------------------------------------------------------------------- Forgot to CC Jira at the time ---------- 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? -- BEGIN SNIPPET -- find -type f /var/www/cache -- END SNIPPET -- 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. -- BEGIN SNIPPET -- GET -Ssed -H "Host: www.yoursite.com" "http://127.0.0.1:80/index.php?option=com_users" -- END SNIPPET -- and see whether Apache is setting anything. Also, if you add -- BEGIN SNIPPET -- add_header X-Cache-Status $upstream_cache_status; -- END SNIPPET -- 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 ----------------------------------------------------------------------------------------- mail handler added 'chfbcaij.png' to Attachments ----------------------------------------------------------------------------------------- 2014-11-08 19:15:27 ----------------------------------------------------------------------------------------- mail handler added 'fggfhdha.png' to Attachments ----------------------------------------------------------------------------------------- 2014-11-08 19:15:27 ----------------------------------------------------------------------------------------- mail handler added 'hbabjgcc.png' to Attachments ----------------------------------------------------------------------------------------- 2014-11-08 19:15:28 ----------------------------------------------------------------------------------------- mail handler added 'hbabjgcc.png' to Attachments ----------------------------------------------------------------------------------------- 2014-11-08 19:15:28 ----------------------------------------------------------------------------------------- mail handler added 'fggfhdha.png' to Attachments ----------------------------------------------------------------------------------------- 2014-11-08 19:15:28 ----------------------------------------------------------------------------------------- mail handler added 'chfbcaij.png' to Attachments ----------------------------------------------------------------------------------------- 2014-11-09 00:54:40 ----------------------------------------------------------------------------------------- btasker removed 'fggfhdha.png' from Attachment ----------------------------------------------------------------------------------------- 2014-11-09 00:54:45 ----------------------------------------------------------------------------------------- btasker removed 'hbabjgcc.png' from Attachment ----------------------------------------------------------------------------------------- 2014-11-09 00:54:56 ----------------------------------------------------------------------------------------- btasker removed 'hbabjgcc.png' from Attachment ----------------------------------------------------------------------------------------- 2014-11-09 00:55:00 ----------------------------------------------------------------------------------------- btasker removed 'fggfhdha.png' from Attachment ----------------------------------------------------------------------------------------- 2014-11-09 00:55:09 ----------------------------------------------------------------------------------------- btasker removed 'chfbcaij.png' from Attachment ----------------------------------------------------------------------------------------- 2014-11-09 00:55:13 ----------------------------------------------------------------------------------------- btasker removed 'chfbcaij.png' from Attachment ----------------------------------------------------------------------------------------- 2014-11-09 01:02:30 btasker ----------------------------------------------------------------------------------------- Closing as Cannot Reproduce as haven't been able to replicate the issue and the user hasn't responded. ----------------------------------------------------------------------------------------- 2014-11-09 01:02:30 ----------------------------------------------------------------------------------------- btasker changed status from 'Open' to 'Resolved' ----------------------------------------------------------------------------------------- 2014-11-09 01:02:30 ----------------------------------------------------------------------------------------- btasker added 'Cannot Reproduce' to resolution ----------------------------------------------------------------------------------------- 2014-11-09 01:02:35 ----------------------------------------------------------------------------------------- btasker changed status from 'Resolved' to 'Closed'