on 2008-12-09 22:52
on 2008-12-10 00:45
on 2008-12-10 06:03
Thanks. Is there a delete_header or replace_header directive? I'm trying to specify the character encoding for my css file, and this results in two Content-Type headers: HTTP/1.1 200 OK Server: nginx/0.6.34 Date: Wed, 10 Dec 2008 04:43:16 GMT Content-Type: text/css Content-Length: 12577 Last-Modified: Wed, 10 Dec 2008 02:39:22 GMT Connection: keep-alive Cache-Control: max-age=86400, must-revalidate Content-Type: text/css; charset=iso-8859-1 Accept-Ranges: bytes I suppose this is a mostly pointless thing to do, but I'm trying to learn how nginx works with headers. I expected that when I did "add_header Content-Type" that it would have the option of replacing any existing header. Kevin
on 2008-12-10 06:24
why would you add a header that is already sent by default?
on 2008-12-10 07:53
I was just thinking that it might be good to say what charset the .css uses rather than relying on the browser to default to the correct encoding. As I said, I'm just trying to learn and this particular example of replacing a header might not be the best, but I would like to understand how to replace headers.
on 2008-12-10 08:01
You can add additional headers but the proper headers for normal HTTP behavior will be sent automatically by nginx. You only need to add different headers that aren't already included. Or you can push headers through using a server-side language like PHP too..
on 2008-12-10 08:19
On Tue, Dec 09, 2008 at 11:50:23PM -0500, KT Walrus wrote: > Content-Type: text/css > I expected that when I did "add_header Content-Type" that it would > have the option of replacing any existing header. You may set charset using charset iso-8859-1; There is no delete_header or replace_header. You may delete a header using add_header NAME ""; but it does not works with any headers.