# CSS file in Facebook app being served up as text/html

**URL:** <https://www.ruby-forum.com/t/css-file-in-facebook-app-being-served-up-as-text-html/212147>\
**Category:** NGINX\
**Created:** [September 23, 2011, 8:45am UTC](https://www.ruby-forum.com/t/css-file-in-facebook-app-being-served-up-as-text-html/212147 "2011-09-23T08:45:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [September 23, 2011, 8:45am UTC](https://www.ruby-forum.com/t/css-file-in-facebook-app-being-served-up-as-text-html/212147/1 "2011-09-23T08:45:43Z")

</div>

I’m hosting a Facebook canvas app on my server and a CSS file is not  
getting loaded because it’s apparently being served up as text/html and  
not text/css.

I have no problems with the css files on my web site hosted on the same  
server and my nginx conf has the standard mime types file loaded in the  
conf.

Not sure why calling it in a facebook iframe is causing the error.  
Here’s the dump from Live HTTP Headers:

GET /myappname/multifriend.css HTTP/1.1  
Host: [www.example.com](http://www.example.com)  
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101  
Firefox/6.0.2  
Accept: text/css,_/_;q=0.1  
Accept-Language: en-gb,en;q=0.5  
Accept-Encoding: gzip, deflate  
Accept-Charset: ISO-8859-1,utf-8;q=0.7,\*;q=0.7  
Connection: keep-alive  
Referer: [https://www.example.com/myappname/invite3.php](https://www.example.com/myappname/invite3.php)

HTTP/1.1 200 OK  
Date: Fri, 23 Sep 2011 06:28:49 GMT  
Content-Type: text/html  
Transfer-Encoding: chunked  
Connection: keep-alive  
X-Powered-By: PHP/5.3.6

Thanks!

---

<div class="post-metadata">

**Author:** ![peterpiper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3e96dc/32.png) [@peterpiper](https://www.ruby-forum.com/u/peterpiper)\
**Post date:** [September 23, 2011, 1:10pm UTC](https://www.ruby-forum.com/t/css-file-in-facebook-app-being-served-up-as-text-html/212147/2 "2011-09-23T13:10:18Z")

</div>

> I have no problems with the css files on my web site hosted on the same server  
> and my nginx conf has the standard mime types file  
> loaded in the conf.

Post your nginx config since you may have a misconfiguration somewhere  
and css files are being served through php - header line’  
X-Powered-By: PHP/5.3.6’ indicates that (it shouldn’t be there for  
static content).

p.s. If that is intended though you will have to modify your php and add

\<? header('Content-type: text/css'); ?\> at the top.

rr

---

<div class="post-metadata">

**Author:** ![peterpiper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3e96dc/32.png) [@peterpiper](https://www.ruby-forum.com/u/peterpiper)\
**Post date:** [September 23, 2011, 9:12pm UTC](https://www.ruby-forum.com/t/css-file-in-facebook-app-being-served-up-as-text-html/212147/3 "2011-09-23T21:12:40Z")

</div>

On 23/09/2011 7:09 AM, Reinis R. wrote:

> Post your nginx config since you may have a misconfiguration somewhere  
> and css files are being served through php - header line’ X-Powered-By:  
> PHP/5.3.6’ indicates that (it shouldn’t be there for static content).

You hit the nail on the head…I don’t do much work on the SSL side of  
my server and forgot to allow it to be served directly.

Thanks.
