Please, help me resolve a problem, when Nginx always returns 404 for main directory.
So here sites-available/dev.vshvetsov.ru config%
server {
listen 80;
server_name dev.vshvetsov.ru;
location / {
proxy_pass http://127.0.0.1:8001;
access_log /var/log/nginx/dev.vshvetsov.ru-access.log;
}
location ~* ^.+\.(css|js|png|gif|jp[e]?g|swf|svg|woff|eot|ttf|cur|map|txt|pdf)$ {
root /vault/development/dev.vshvetsov.ru/htdocs;
#access_log off;
expires 30d;
}
}
So what i've already done:
- Made an A-record for my IP and it works
- Made a reference ln -s to sites-enabled/
- Created root directory
- Restart and reload NGINX
- Tried to add root path/to/htdocs; and index index.html in Location / {} settings;
- Set the htdocs access mode recursive 777
When i'm trying to open dev.vshvetsov.ru I see the 404. But if I try to open dev.vshvetsov.ru/data/ingredients/1.txt I get the file contents
Here is the access.log record of my error
109.188.124.16 - - [02/Sep/2016:18:54:32 +0300] "GET / HTTP/1.1" 404 345 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.7 (KHTML, like Gecko) Version/9.1.2 Safari/601.7.7"
Thank you all, who will try to resolve it with me!
Best Regards