PLGSCH-3: Headers not being sent



Issue Information

Issue Type: Bug
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Send Custom Headers (PLGSCH)
Resolution: Cannot Reproduce (2014-11-09 01:02:30)
Components: Plugin ,

Created: 2014-05-16 13:24:45
Time Spent Working


Description
Issue reported by a user, will forward the emails on in a second


Attachments

Toggle State Changes

Activity


---------- 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;
                }
}


}


Please advise.

Thanks!
mail handler added 'fggfhdha.png' to Attachments
mail handler added 'hbabjgcc.png' to Attachments
mail handler added 'chfbcaij.png' to Attachments
---------- 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!
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?

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.

GET -Ssed -H "Host: www.yoursite.com" "http://127.0.0.1:80/index.php?option=com_users"


and see whether Apache is setting anything.

Also, if you add

add_header X-Cache-Status $upstream_cache_status;


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
mail handler added 'chfbcaij.png' to Attachments
mail handler added 'fggfhdha.png' to Attachments
mail handler added 'hbabjgcc.png' to Attachments
mail handler added 'hbabjgcc.png' to Attachments
mail handler added 'fggfhdha.png' to Attachments
mail handler added 'chfbcaij.png' to Attachments
btasker removed 'fggfhdha.png' from Attachment
btasker removed 'hbabjgcc.png' from Attachment
btasker removed 'hbabjgcc.png' from Attachment
btasker removed 'fggfhdha.png' from Attachment
btasker removed 'chfbcaij.png' from Attachment
btasker removed 'chfbcaij.png' from Attachment
Closing as Cannot Reproduce as haven't been able to replicate the issue and the user hasn't responded.
btasker changed status from 'Open' to 'Resolved'
btasker added 'Cannot Reproduce' to resolution
btasker changed status from 'Resolved' to 'Closed'