logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Problem with apache headers
Author
sawyoh



Joined: 28 Aug 2014
Posts: 2

PostPosted: Thu 28 Aug '14 14:16    Post subject: Problem with apache headers Reply with quote

Hi,

I am trying to setup dynamic content configuration in apache 2.2 httpd conf. Here is the configuration and couple test cases:

CONF:
<FilesMatch "\.(js|css|gif|jpg|jpeg|png)$">
Header set Cache-Control "no-cache, no-store, max-age=0, must-revalidate"
</FilesMatch>

TEST 1:
Without <FilesMatch> directive, the headers are set to all requested content as it should. This includes content served from apache server and content from a separate application server.

TEST 2:
If I use the above configuration example, I can see that static content comes with correct headers only when the content is served from apache (mainpage and some pictures are handled by apache). However, all other static content in applications that reside in a separate application server no longer have the header information.

I have not been able to find a relevant article other than basic guides to Apache Headers but these don't take a separate application server into an account (though, I guess they should not as the requests and responses are tunneled through apache).

What could be the issue? is the FilesMatch only working with content served from apache? Should I use another directive to capture the static content that is served from my application server? Could this be a regex issue or maybe something to do with folder/file permissions?

Here is an example of headers captured with Fiddler. In this scenario (TEST 2), the picture "player_fi.jpg" does not have any header information.

GET https://dev.server.fi/mediaplayer/images/player_fi.jpg HTTP/1.1
Accept: image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5
Referer: https://dev.server.fi/mediaplayer/frontpage.do
Accept-Language: fi-FI
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: dev.server.fi
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Thu, 28 Aug 2014 11:51:03 GMT
Server: Apache
Accept-Ranges: bytes
Last-Modified: Thu, 01 Nov 2013 07:30:24 GMT
X-Powered-By: Servlet/3.0 JSP/2.2
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/jpeg
Set-Cookie: expires=Thu, 22-Aug-2014 13:31:03 GMT;path=/;secure;httponly

All insights highly appreciated!

Br,

Sawyoh
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 01 Sep '14 11:40    Post subject: Reply with quote

Quote:

X-Powered-By: Servlet/3.0 JSP/2.2


Are you sure that the file served by httpd apache and not the backend server?
Back to top


Reply to topic   Topic: Problem with apache headers View previous topic :: View next topic
Post new topic   Forum Index -> Apache