nginx unknown directive «upstream»

Я использую nginx в качестве прокси-сервера для пересылки запросов на мой сервер Gunicorn. Когда я запускаю sudo nginx -t -c / etc / nginx / sites-enabled / mysite Я получаю следующую ошибку:

[emerg]: unknown directive "upstream" in /etc/nginx/sites-enabled/mysite:1
configuration file /etc/nginx/sites-enabled/mysite test failed

Есть идеи, как это исправить? Это моя конфигурация nginx:

upstream gunicorn_mysite {
    server 127.0.0.1:8000 fail_timeout=0;
}

server {
    listen 80;
    server_name example.com;

    access_log /usr/local/django/logs/nginx/mysite_access.log;
    error_log /usr/local/django/logs/nginx/mysite_error.log;

    location / {
        proxy_pass http://gunicorn_mysite;
    }
}

Я использую Ubuntu 10.04, и моя версия nginx - 0.7.65, которую я установил из apt.

Это результат выполнения nginx -V

nginx version: nginx/0.7.65
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6 --add-module=/build/buildd/nginx-0.7.65/modules/nginx-upstream-fair
19
задан approxiblue 28 September 2016 в 18:54
поделиться