server {
listen 80;
server_name project.ru;
location /static/ {
autoindex on;
root /var/www;
}
location / {
set $frame_options '';
if ($http_referer !~ '^https?:\/\/([^\/]+\.)?(project\.ru|webvisor\.com|metri[ck]a\.yandex\.(com|ru|by|com\.tr))\/'){
set $frame_options 'SAMEORIGIN';
}
add_header X-Frame-Options $frame_options;
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/project.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/project.ru/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
$ pwd
/home/www/project.ru/project/deployment/collected_static
$ ls -la
total 1080
drwxrwxr-x 5 www www 4096 May 1 11:59 .
drwxrwxr-x 3 www www 4096 May 1 11:59 ..
drwxrwxr-x 6 www www 4096 May 1 11:59 admin
-rw-r--r-- 1 www www 22579 May 1 11:59 card-image.png
-rw-r--r-- 1 www www 6928 May 1 11:59 city.png
drwxrwxr-x 4 www www 4096 May 1 11:59 debug_toolbar
-rw-r--r-- 1 www www 4286 May 1 11:59 favicon.ico
-rw-r--r-- 1 www www 34742 May 1 11:59 feature1.png
-rw-r--r-- 1 www www 171521 May 1 11:59 feature2.png
-rw-r--r-- 1 www www 129887 May 1 11:59 feature3.png
-rw-r--r-- 1 www www 690389 May 1 11:59 jumbotron-background.jpg
drwxrwxr-x 7 www www 4096 May 1 11:59 mdeditor
-rw-r--r-- 1 www www 324 May 1 11:59 style.css
87.255.2.212 - - [01/May/2023:13:34:44 +0000] "GET / HTTP/1.1" 200 3163 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 YaBrowser/23.1.5.751 Yowser/2.5 Safari/537.36"
87.255.2.212 - - [01/May/2023:13:34:44 +0000] "GET /static/style.css HTTP/1.1" 404 1140 "http://project.ru/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 YaBrowser/23.1.5.751 Yowser/2.5 Safari/537.36"
87.255.2.212 - - [01/May/2023:13:34:44 +0000] "GET /static/feature1.png HTTP/1.1" 404 1149 "http://project.ru/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 YaBrowser/23.1.5.751 Yowser/2.5 Safari/537.36"
87.255.2.212 - - [01/May/2023:13:34:44 +0000] "GET /static/feature2.png HTTP/1.1" 404 1149 "http://project.ru/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 YaBrowser/23.1.5.751 Yowser/2.5 Safari/537.36"
87.255.2.212 - - [01/May/2023:13:34:44 +0000] "GET /static/feature3.png HTTP/1.1" 404 1149 "http://project.ru/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 YaBrowser/23.1.5.751 Yowser/2.5 Safari/537.36"
87.255.2.212 - - [01/May/2023:13:34:44 +0000] "GET /static/jumbotron-background.jpg HTTP/1.1" 404 1156 "http://project.ru/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 YaBrowser/23.1.5.751 Yowser/2.5 Safari/537.36"