K
K
kitaisc2013-03-02 02:35:21
Nginx
kitaisc, 2013-03-02 02:35:21

Help compose a location

Help me make a rule so that only *.attach and *.thumb files can access the directory

Thank you very much.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Slinko, 2013-03-02
@kitaisc

Try this way:

server {
  root /forder;
  location /subfolder {
    location ~ \.attach$ {
      try_files $uri =404;
    }
    location ~ \.thumb$ {
      try_files $uri =404;
    }
    return 403;
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question