Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting my son up so he can manage his simple website by editing a file on dropbox.

My nginx config looks like this:---

server {
        listen 80;
        server_name *;
        location / {

This works fine for serving the index.html file. The problem is if he puts an img tag in the index.html file that points to a jpeg in the same directory as his index.html file on dropbox. it doesn't get picked up. Is there anyway to do this?

share|improve this question

closed as off topic by Zoredache, Sven, Tom O'Connor, Michael Hampton, Scott Pack Dec 10 '12 at 18:56

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Break it up into two location blocks. One so that you can be served images (and all other assets) in the root directory, but also telling it to serve images by rewriting it and then proxy passing it. And the other block for serving the index file in the root.

Not tested, but should work.

location / {

location ~* \.(jpg|jpeg|gif|png|bmp|ico|css|js) {
   rewrite /(.*) /$1 break;
share|improve this answer
This gives an error: nginx: [emerg] "proxy_pass" may not have URI part in location given by regular expression, or inside named location,... – flc Dec 10 '12 at 8:22
Whoopsie, forgot that proxy_pass needed a URI part. Updated the answer for you. – Taylor Jasko Dec 10 '12 at 8:24
Thanks, but still giving the same error. – flc Dec 10 '12 at 8:33
Very strange -- quite confused as that should be working. – Taylor Jasko Dec 10 '12 at 8:54

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