--> error = "Invalid character in header name."
--> header_name = "last-modified:"
--> header_value = "Thursday,%2009-Aug-2018%2001:21:53%20GMT"

This error message is preventing static content from being displayed in Chrome


2 Answers 2


The issue turned out to be the colon in header_name = "last-modified:" Basically, there were two colons in the ngnix config file, which lead Chrome to throw an error (Firefox, on the other hand, ignores this and renders the page). The header_name should simply be header_name = "last-modified"


Despite that that the error description indicates the problem is in the "header name," I suspect that the issue is actually with the header_value.

On StackOverflow, The date/time format used in HTTP headers says

In section 14.29 Last-Modified you can see that date format should be:

"Last-Modified" ":" HTTP-date

An example of its use is

Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT

The last modified date in your error doesn't look like that. It doesn't have any spaces. Instead they have been replaced by %20 which indicates that the date has been URL encoded.

I don't know of any reason that the standard HTTP headers should be encoded like that. See on StackOverflow: Is it appropriate or necessary to use percent-encoding with HTTP Headers? I'm not sure how you would have configured your server to percent-encode the last-modified header. However you did it, the solution to your problem should be to remove that encoding.

Chrome is probably encountering the first % and is saying "I didn't expect a percent there! Invalid character."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.