S
S
Svyatoslav Nemato2017-04-05 11:32:27
Nginx
Svyatoslav Nemato, 2017-04-05 11:32:27

Nginx + apache2 deny from all directives not working?

OS: Ubuntu 16.10
Bundle: Nginx + apache2
I registered in the .htaccess file

order allow,deny
deny from all

When accessing the site through port 8080 ( site.ru:8080/file/1.jpg ) on which apache2 is running, the .htaccess file works correctly and does not give me a picture.
When accessing directly, without a port ( site.ru/file/1.jpg ), the server ignores the rule in .htaccess and gives me a picture.
How to deal with it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Svyatoslav Nemato, 2017-04-05
@makklovskiy

location ~ /file/(.+)\.*$ {
          deny all;
}

A
Andrey Zubkov, 2017-04-05
@zubkov_work

Block in nginx, as it most likely gives away static.

location /file/1.jpg {
   deny all;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question