• Nginx делает редирект с дефолтной системой и конфигами?

    @Heavy10110 Автор вопроса
    Владимир Муковоз: Хм, действительно. Зашел с телефона на ip и попал на заглушку сразу, а вот с компа пытаюсь зайти , меня редиректит на ip/index. Браузер? Кэш? Очень странно
  • Nginx делает редирект с дефолтной системой и конфигами?

    @Heavy10110 Автор вопроса
    Pavel Denisov: Нет, у меня пробный период vps на sprintbox. Из админки просто другую систему выбрал и поставил.
  • Nginx делает редирект с дефолтной системой и конфигами?

    @Heavy10110 Автор вопроса
    nginx.conf
    user www-data;
    worker_processes auto;
    pid /run/nginx.pid;
    
    events {
            worker_connections 768;
    }
    http {
            sendfile on;
            tcp_nopush on;
            tcp_nodelay on;
            keepalive_timeout 65;
            types_hash_max_size 2048;
    
            include /etc/nginx/mime.types;
            default_type application/octet-stream;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
            ssl_prefer_server_ciphers on;
    
            access_log /var/log/nginx/access.log;
            error_log /var/log/nginx/error.log;
    
            gzip on;
            gzip_disable "msie6";
    
            include /etc/nginx/conf.d/*.conf;
            include /etc/nginx/sites-enabled/*;
    }


    в sites-available 1 файл default.
    server {
            listen 80 default_server;
            listen [::]:80 default_server;
    
    
            root /var/www/html;
    
            index index.html index.htm index.nginx-debian.html;
    
            server_name _;
    
            location / {
                    try_files $uri $uri/ =404;
            }
    
    }

    Причем если я перехожу на ip/index.nginx-debian.html заглушечка открывается.
  • Django + gunicorn Active: failed (Result: exit-code)?

    @Heavy10110 Автор вопроса
    C правами и пользователями все в порядке.
  • Postgresql + django (Is the server running on host "ip" and accepting TCP/IP connections on port 5432?

    @Heavy10110 Автор вопроса
    Сергей Горностаев: psql: could not connect to server: Connection refused
    Is the server running on host "ip" and accepting
    TCP/IP connections on port 5432?
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем: Ну так какой у тебя телеграмм?)
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем: Написал на почту
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем:
    109.167.253.79 - - [03/May/2017:15:05:30 +0300] "GET /admin/login/?next=/admin/ HTTP/1.1" 200 870 "-" "Mozilla/5.0 (X11; Ubuntu; Linux$
    109.167.253.79 - - [03/May/2017:15:05:30 +0300] "GET /static/admin/css/base.css HTTP/1.1" 404 142 "http://194.87.102.184/admin/login/?$
    109.167.253.79 - - [03/May/2017:15:05:30 +0300] "GET /static/admin/css/login.css HTTP/1.1" 404 142 "http://194.87.102.184/admin/login/$
    109.167.253.79 - - [03/May/2017:15:05:34 +0300] "GET /post/ HTTP/1.1" 200 1921 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) G$
    109.167.253.79 - - [03/May/2017:15:05:34 +0300] "GET /media/None/tarantino-20years-filmmaking.jpg HTTP/1.1" 404 260 "http://194.87.102$
    109.167.253.79 - - [03/May/2017:15:05:34 +0300] "GET /media/None/385439.jpg HTTP/1.1" 404 260 "http://194.87.102.184/post/" "Mozilla/5$
    109.167.253.79 - - [03/May/2017:15:05:35 +0300] "GET /static/css/base.css HTTP/1.1" 404 142 "http://194.87.102.184/post/" "Mozilla/5.0$
    109.167.253.79 - - [03/May/2017:15:05:35 +0300] "GET /media/None/tarantino-20years-filmmaking.jpg HTTP/1.1" 404 260 "http://194.87.102$
    109.167.253.79 - - [03/May/2017:15:05:35 +0300] "GET /media/None/385439.jpg HTTP/1.1" 404 260 "http://194.87.102.184/post/" "Mozilla/5$
    187.87.87.27 - - [03/May/2017:15:05:44 +0300] "GET / HTTP/1.1" 404 340 "-" "curl/7.17.1 (mips-unknown-linux-gnu) libcurl/7.17.1 OpenSS$
    187.87.87.80 - - [03/May/2017:15:19:06 +0300] "GET / HTTP/1.1" 499 0 "-" "curl/7.17.1 (mips-unknown-linux-gnu) libcurl/7.17.1 OpenSSL/$
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем:
    int@debian:/home/Django-blog/static_cdn$ tree
    .
    ├── admin
    │   ├── css
    │   │   ├── base.css
    │   │   ├── changelists.css
    │   │   ├── dashboard.css
    │   │   ├── fonts.css
    │   │   ├── forms.css
    │   │   ├── login.css
    │   │   ├── pagedown.css
    │   │   ├── rtl.css
    │   │   └── widgets.css
    │   ├── fonts
    │   │   ├── LICENSE.txt
    │   │   ├── README.txt
    │   │   ├── Roboto-Bold-webfont.woff
    │   │   ├── Roboto-Light-webfont.woff
    │   │   └── Roboto-Regular-webfont.woff
    │   ├── img
    │   │   ├── calendar-icons.svg
    │   │   ├── gis
    │   │   │   ├── move_vertex_off.svg
    │   │   │   └── move_vertex_on.svg
    │   │   ├── icon-addlink.svg
    │   │   ├── icon-alert.svg
    │   │   ├── icon-calendar.svg
    │   │   ├── icon-changelink.svg
    │   │   ├── icon-clock.svg
    │   │   ├── icon-deletelink.svg
    │   │   ├── icon-no.svg
    │   │   ├── icon-unknown-alt.svg
    │   │   ├── icon-unknown.svg
    │   │   ├── icon-yes.svg
    │   │   ├── inline-delete.svg
    │   │   ├── LICENSE
    │   │   ├── README.txt
    │   │   ├── search.svg
    │   │   ├── selector-icons.svg
    │   │   ├── sorting-icons.svg
    │   │   ├── tooltag-add.svg
    │   │   └── tooltag-arrowright.svg
    │   └── js
    │       ├── actions.js
    │       ├── actions.min.js
    │       ├── admin
    │       │   ├── DateTimeShortcuts.js
    │       │   └── RelatedObjectLookups.js
    │       ├── calendar.js
    │       ├── cancel.js
    │       ├── change_form.js
    │       ├── collapse.js
    │       ├── collapse.min.js
    │       ├── core.js
    │       ├── inlines.js
    │       ├── inlines.min.js
    │       ├── jquery.init.js
    │       ├── pagedown.js
    │       ├── popup_response.js
    │       ├── prepopulate_init.js
    │       ├── prepopulate.js
    │       ├── prepopulate.min.js
    │       ├── SelectBox.js
    │       ├── SelectFilter2.js
    │       ├── timeparse.js
    │       ├── urlify.js
    │       └── vendor
    │           ├── jquery
    │           │   ├── jquery.js
    │           │   ├── jquery.min.js
    │           │   └── LICENSE-JQUERY.txt
    │           └── xregexp
    │               ├── LICENSE-XREGEXP.txt
    │               ├── xregexp.js
    │               └── xregexp.min.js
    ├── css
    │   └── base.css
    ├── pagedown
    │   ├── demo
    │   │   ├── browser
    │   │   │   ├── demo.css
    │   │   │   └── demo.html
    │   │   └── node
    │   │       └── demo.js
    │   ├── LICENSE.txt
    │   ├── local
    │   │   └── Markdown.local.fr.js
    │   ├── Markdown.Converter.js
    │   ├── Markdown.Editor.js
    │   ├── Markdown.Sanitizer.js
    │   ├── node-pagedown.js
    │   └── wmd-buttons.png
    ├── pagedown-extra
    │   ├── Markdown.Extra.js
    │   └── pagedown
    │       └── Markdown.Converter.js
    └── pagedown_init.js
    
    18 directories, 77 files

    в /home/Django-blog/static_cdn; наличие css/base.css - есть
    Я уже не понимаю что мне тыкать в nginx.
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем:
    <!-- Link to css file of the project (local) -->
    <link rel="stylesheet" type="text/css" href='{% static "css/base.css" %}' />
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем: Собственно после
    int@debian:/home/Django-blog$ cd mysite/
    int@debian:/home/Django-blog/mysite$ ls
    blog  comments	db.sqlite3  manage.py  mysite  static
    int@debian:/home/Django-blog/mysite$ gunicorn mysite.wsgi:application
    [2017-05-03 14:36:03 +0000] [62096] [INFO] Starting gunicorn 19.7.1
    [2017-05-03 14:36:03 +0000] [62096] [INFO] Listening at: http://127.0.0.1:8000 (62096)
    [2017-05-03 14:36:03 +0000] [62096] [INFO] Using worker: sync
    [2017-05-03 14:36:03 +0000] [62101] [INFO] Booting worker with pid: 62101

    Сайт запускается на 80 порту, все отображается, кроме стилей....
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем: Увы, статика все равно не подключилась. После
    Изменения пути в nginx.
    server {
        listen 80;
        server_name мой_ip; #либо ip, либо доменное имя
        access_log  /var/log/nginx/example.log;
    
        location /static/ {
            root /home/Django-blog/static_cdn;
            expires 30d;
        }
    
        location / {
            proxy_pass http://127.0.0.1:8000;
            proxy_set_header Host $server_name;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
      }

    И после сделав
    int@debian:/home/Django-blog/mysite$ python manage.py collectstatic
    
    You have requested to collect static files at the destination
    location as specified in your settings:
    
        /home/Django-blog/static_cdn
    
    This will overwrite existing files!
    Are you sure you want to do this?
    
    Type 'yes' to continue, or 'no' to cancel: yes
    
    0 static files copied to '/home/Django-blog/static_cdn', 77 unmodified.

    Получаю, что 0 файлов скопировано
    Куда дальше двигаться ?
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Дмитрий Бурнаев:
    Поменял путь в конфиге nginx. Сделал рестарт nginx.
    Делаю
    int@debian:/home/Django-blog/mysite$ python manage.py collectstatic
    
    You have requested to collect static files at the destination
    location as specified in your settings:
    
        /home/Django-blog/static_cdn
    
    This will overwrite existing files!
    Are you sure you want to do this?
    
    Type 'yes' to continue, or 'no' to cancel: y
    CommandError: Collecting static files cancelled.


    Я видимо понял. У меня нет такой директории вообще "/home/Django-blog/static_cdn" У меня есть
    " /home/splitpoint/Django-blog/static_cdn/"
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Дмитрий Бурнаев: Не помогло, опять же
    int@debian:/home/Django-blog/mysite$ python manage.py collectstatic
    
    You have requested to collect static files at the destination
    location as specified in your settings:
    
        /home/Django-blog/static_cdn
    
    This will overwrite existing files!
    Are you sure you want to do this?
    
    Type 'yes' to continue, or 'no' to cancel: y
    CommandError: Collecting static files cancelled.
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    int@debian:/home/Django-blog/mysite$ python manage.py collectstatic
    
    You have requested to collect static files at the destination
    location as specified in your settings:
    
        /home/Django-blog/static_cdn
    
    This will overwrite existing files!
    Are you sure you want to do this?
    
    Type 'yes' to continue, or 'no' to cancel: y
    CommandError: Collecting static files cancelled.


    int@debian:/home/Django-blog/mysite$ python manage.py collectstatic --noinput
    
    0 static files copied to '/home/Django-blog/static_cdn', 77 unmodified.
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Артем:
    /etc/nginx/sites-available
    server {
        listen 80;
        server_name мой_ip; #либо ip, либо доменное имя
        access_log  /var/log/nginx/example.log;
    
        location /static/ {
            root home/splitpoint/Django-blog/mysite/static/;
            expires 30d;
        }
    
        location / {
            proxy_pass http://127.0.0.1:8000;
            proxy_set_header Host $server_name;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
      }
  • Не подключается css (staticfiles, staticroot)?

    @Heavy10110 Автор вопроса
    Сергей Горностаев: На VPS Nginx сервер стоит