# Can't make a simple configuration

**URL:** <https://www.ruby-forum.com/t/cant-make-a-simple-configuration/209671>\
**Category:** NGINX\
**Created:** [July 19, 2011, 11:51pm UTC](https://www.ruby-forum.com/t/cant-make-a-simple-configuration/209671 "2011-07-19T23:51:10Z")\
**Posts on this page:** 2\
**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:** [July 19, 2011, 11:51pm UTC](https://www.ruby-forum.com/t/cant-make-a-simple-configuration/209671/1 "2011-07-19T23:51:10Z")

</div>

Hi,

This will be an absolute beginner question. Sorry about that. What I  
want to  
do is, I want to serve all files under [http://localhost/static](http://localhost/static) from  
/home/myname/public\_html/static

My configuration regarding that part:

location ~ /static/\* {  
root /home/yasar/public\_html/;  
}

I have put index files just to test it in ~/public\_html/static adming  
folder  
under static folder and css folder under admin folder and I can see all  
of  
index.html files. But when I try to get an css file there, I get this  
error  
(from error log):

2011/07/20 00:42:27 [error] 7749#0: \*1 open()  
“/etc/nginx/html/static/admin/css/ie.css” failed (2: No such file or  
directory), client: 127.0.0.1, server: localhost, request: “GET  
/static/admin/css/ie.css HTTP/1.1”, host: “localhost”

appereantly, my root directive doesn’t work some reason. Any help would  
be  
appriciated.

Yaar Arabac.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 20, 2011, 12:20am UTC](https://www.ruby-forum.com/t/cant-make-a-simple-configuration/209671/2 "2011-07-20T00:20:56Z")

</div>

Hello!

The reason being that the asterisk “\*” is irrelevant in the PCRE (Perl  
Regex syntax) expression for what you intend it to do.

Try the following, instead (no regex):

location /static/ {  
root /home/yasar/public\_html;  
}

Hope it helps,

Andrejs

Posted at Nginx Forum:

> **[Re: Can't make a simple configuration...](https://forum.nginx.org/read.php?2,212661,212662#msg-212662)**
>
> Hi, This will be an absolute beginner question. Sorry about that. What I want to do is, I want to serve all files under http://localhost/static from /home/myname/public\_html/static My configuration regarding that part: location ~ /static/\* {
