# Root directory is lost when proxy\_pass / to another machine

**URL:** <https://www.ruby-forum.com/t/root-directory-is-lost-when-proxy-pass-to-another-machine/208009>\
**Category:** NGINX\
**Created:** [June 8, 2011, 7:23am UTC](https://www.ruby-forum.com/t/root-directory-is-lost-when-proxy-pass-to-another-machine/208009 "2011-06-08T07:23:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 8, 2011, 7:23am UTC](https://www.ruby-forum.com/t/root-directory-is-lost-when-proxy-pass-to-another-machine/208009/1 "2011-06-08T07:23:18Z")

</div>

Hello,

I have two server, 10.1.1.1, 10.1.1.2.

10.1.1.1 have following nginx.conf, it forword “/” to 10.1.1.2, and it  
also has “/upload.php” page.

location / {  
root html;  
proxy\_pass [http://10.1.1.2](http://10.1.1.2);  
}

location /upload.php {  
root html;  
fastcgi\_pass 127.0.0.1:9000;  
fastcgi\_param SCRIPT\_FILENAME  
/opt/nginx/html/$fastcgi\_script\_name;  
include fastcgi\_params;  
}

My problem is  
In upload.php page, it has

However, the css is not working for [http://10.1.1.1/upload.php](http://10.1.1.1/upload.php)

If I comment out proxy\_pass [http://10.1.1.2](http://10.1.1.2);  
then css is working fine for upload.php page.

Could anyone help me to solve the issue?  
Thank you.

---

<div class="post-metadata">

**Author:** ![yanxin\_z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/d6d6ee/32.png) [@yanxin\_z](https://www.ruby-forum.com/u/yanxin_z)\
**Post date:** [June 8, 2011, 7:28am UTC](https://www.ruby-forum.com/t/root-directory-is-lost-when-proxy-pass-to-another-machine/208009/2 "2011-06-08T07:28:29Z")

</div>

The problem is solved 🙂

Add this into nginx.conf in 10.1.1.1

location /css {  
root html;  
}
