# CSS 404 Error

**URL:** <https://www.ruby-forum.com/t/css-404-error/222336>\
**Category:** NGINX\
**Created:** [August 27, 2012, 1:59pm UTC](https://www.ruby-forum.com/t/css-404-error/222336 "2012-08-27T13:59:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 27, 2012, 1:59pm UTC](https://www.ruby-forum.com/t/css-404-error/222336/1 "2012-08-27T13:59:56Z")

</div>

HI,

Ngix giving ‘404 Not Found’ error when I am trying to access the below  
url:  
[http://mysite.com/skin/frontend/tester/default/css/styles-ie.css](http://mysite.com/skin/frontend/tester/default/css/styles-ie.css)’  
but at the same time I can access php file from the same locaiton:  
[http://mysite.com/skin/frontend/tester/default/css/test.php](http://mysite.com/skin/frontend/tester/default/css/test.php)

Please help.

Posted at Nginx Forum:

> **[CSS 404 Error](https://forum.nginx.org/read.php?2,230099,230099#msg-230099)**
>
> HI, Ngix giving '404 Not Found' error when I am trying to access the below url: http://mysite.com/skin/frontend/tester/default/css/styles-ie.css' but at the same time I can access php file from the same locaiton:...

---

<div class="post-metadata">

**Author:** ![iqbalmp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7cd45c/32.png) [@iqbalmp](https://www.ruby-forum.com/u/iqbalmp)\
**Post date:** [August 27, 2012, 2:00pm UTC](https://www.ruby-forum.com/t/css-404-error/222336/2 "2012-08-27T14:00:15Z")

</div>

Well you didn’t give us anything to work one. First of does that file  
exist  
in the same directoy where test.php is. Can you provide your ngnix.conf,  
maybe you have some redirects for eather php files, or for css files.  
Are  
permissions ok? Maybe Nginx cannot read that file?

It could be many things, but you need to give us more information, if  
you  
would like to get some help.

Posted at Nginx Forum:

> **[Re: CSS 404 Error](https://forum.nginx.org/read.php?2,230099,230101#msg-230101)**
>
> HI, Ngix giving '404 Not Found' error when I am trying to access the below url: http://mysite.com/skin/frontend/tester/default/css/styles-ie.css' but at the same time I can access php file from the same locaiton:...

---

<div class="post-metadata">

**Author:** ![iqbalmp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7cd45c/32.png) [@iqbalmp](https://www.ruby-forum.com/u/iqbalmp)\
**Post date:** [August 27, 2012, 2:00pm UTC](https://www.ruby-forum.com/t/css-404-error/222336/3 "2012-08-27T14:00:28Z")

</div>

kustodian,

Thank You for your fast reply, i have resolved this by editing one of my  
‘location’ in my nginx.conf file:  
…  
location / {  
root /var/www/html;  
index index.php index.html index.htm;  
fastcgi\_param REDIRECT\_STATUS 200;  
}  
…  
Previously this was ‘/usr/share/nginx/html’, but it was ‘var/www/html’  
in  
all other 'location’s.

Posted at Nginx Forum:

> **[Re: CSS 404 Error](https://forum.nginx.org/read.php?2,230099,230103#msg-230103)**
>
> HI, Ngix giving '404 Not Found' error when I am trying to access the below url: http://mysite.com/skin/frontend/tester/default/css/styles-ie.css' but at the same time I can access php file from the same locaiton:...

---

<div class="post-metadata">

**Author:** ![iqbalmp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7cd45c/32.png) [@iqbalmp](https://www.ruby-forum.com/u/iqbalmp)\
**Post date:** [January 4, 2014, 9:37pm UTC](https://www.ruby-forum.com/t/css-404-error/222336/4 "2014-01-04T21:37:09Z")

</div>

I recently encountered an issue with a 1.5.7 branch on OSX. i did not  
check 1.5.8

The following code will set ALL css/js files as the default\_type

```
include /usr/local/nginx/conf/mime.types;
default_type application/octet-stream;

```

The following code works as intended

```
default_type application/octet-stream;
include /usr/local/nginx/conf/mime.types;

```

I haven’t had time to test on other versions.

This could be the intended behavior, but the docs don’t suggest that.  
usually a default\_type only applies when the real type can’t be found.

---

<div class="post-metadata">

**Author:** ![iqbalmp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7cd45c/32.png) [@iqbalmp](https://www.ruby-forum.com/u/iqbalmp)\
**Post date:** [January 9, 2014, 2:18pm UTC](https://www.ruby-forum.com/t/css-404-error/222336/5 "2014-01-09T14:18:35Z")

</div>

Hello!

On Sat, Jan 04, 2014 at 03:36:33PM -0500, Jonathan V. wrote:

> ```
> default_type application/octet-stream;
> include /usr/local/nginx/conf/mime.types;
> 
> ```
> 
> I haven’t had time to test on other versions.
> 
> This could be the intended behavior, but the docs don’t suggest  
> that. usually a default\_type only applies when the real type  
> can’t be found.

Most likely there is a directive with some non-strict syntax (like  
“index”) before they configuration you’ve quoted, and there is no  
semicolon after it. E.g., something like this:

```
index index.html
include /usr/local/nginx/conf/mime.types;
default_type application/octet-stream;

```

While the configuration looks like correct one with mime.types  
included, it’s instead defines 3 index files (“index.html”,  
“include”, “/usr/local/nginx/conf/mime.types”), and default\_type -  
but mime.types isn’t included.

–  
Maxim D.  
[http://nginx.org/](http://nginx.org/)
