Welcome! Log In Create A New Profile

Advanced

Setting custom response headers

June 03, 2009 05:36AM
Hi all,
I'm trying something that I though should be quite simple but turns out it isn't...
I have a rails app and want all static assets with a timestamp query string to be sent with a custom response header called "User-Expires", instead of the regular "expires" directive.
I'm coming from apache, and I'm not sure if proxy_set_header is what I'm looking for or not.
In any case, I'm using the following code:

[code]
if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png|swf)\?[0-9]+$") {
expires 30d;
proxy_set_header User-Expires 300d;
break;
}

[/code]

And I'm getting the following error:
[emerg] 28514#0: "proxy_set_header" directive is not allowed here

I tried moving it to the top (right under all my other proxy_set_headers and it didn't return an error but also did not seem to set the header.

I'm totally confused here - why is it called proxy_set_header when I'm not even using a proxy - i'm just returning the static asset without proxying anything to mongrel. Am I totally missing something here?
Thanks :)
Subject Author Posted

Setting custom response headers

ehudros2 June 03, 2009 05:36AM

Re: Setting custom response headers

Igor Sysoev June 03, 2009 07:37AM

Re: Setting custom response headers

ehudros2 June 03, 2009 08:12AM

Re: Setting custom response headers

ehudros2 June 03, 2009 08:24AM

Re: Setting custom response headers

Igor Sysoev June 03, 2009 08:49AM

Re: Setting custom response headers

ehudros2 June 03, 2009 09:28AM

Re: Setting custom response headers

Igor Sysoev June 03, 2009 09:44AM

Re: Setting custom response headers

ehudros2 June 04, 2009 05:05AM

Re: Setting custom response headers

ehudros2 June 07, 2009 03:10AM

Re: Setting custom response headers

Ian Hobson June 07, 2009 06:18AM

Re: Setting custom response headers

mike June 07, 2009 06:26AM

Re: Setting custom response headers

Igor Sysoev June 07, 2009 03:47PM

Re: Setting custom response headers

mike June 07, 2009 04:03PM

Re: Setting custom response headers

ehudros2 June 08, 2009 03:04AM

Re: Setting custom response headers

Igor Sysoev June 11, 2009 05:24AM

Re: Setting custom response headers

ehudros2 June 11, 2009 06:40AM

Re: Setting custom response headers

Igor Sysoev June 11, 2009 06:48AM

Re: Setting custom response headers

ehudros2 June 07, 2009 07:58AM

Re: Setting custom response headers

Igor Sysoev June 07, 2009 03:18PM

Re: Setting custom response headers

ehudros2 June 10, 2009 03:41AM

Re: Setting custom response headers

ehudros2 June 11, 2009 05:17AM

Re: Setting custom response headers

ehudros2 June 11, 2009 08:26AM

Re: Setting custom response headers

ehudros2 June 16, 2009 04:07AM

Re: Setting custom response headers

Igor Sysoev June 21, 2009 05:43AM

Re: Setting custom response headers

ehudros2 June 21, 2009 08:49AM

Re: Setting custom response headers

ehudros2 June 21, 2009 04:55AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 321
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready