1

gurus. I have a problem and i dont know how to solve it. I am working with Git and Compass/SASS on some projects. Now i want to protect those directories. When i go only to the folder its all fine – i get what i expected a 403 forbidden.

location ~ /\.git {
        deny all;
}

But when i try use the full path to the config file from git the browser start to download it. Same scenario with compass. There is a config.rb file within the folder which also starts to download it. How can i prevent this behaviour?

How can i deny downloading specific files?

YeppThat'sMe
  • 115
  • 1
  • 1
  • 5

1 Answers1

5

You can deny specific file types using

location ~* \.(git|rb|inc|ht)$ {
    deny all;
}
amq
  • 733
  • 2
  • 6
  • 9