Срочный отказ Nginx после обновления на сервере Ubuntu

Ранее пробовали обновить Nginx с 1.14 до 1.14.1. Но при обновлении apt-get я получил:

wallpapershop systemd[1]: Starting A high performance web server and a        reverse proxy server...
wallpapershop nginx[31861]: nginx: [emerg] duplicate upstream  "fastcgi_backend" in /etc/nginx/sites-enabled/wallpapershop.gr.conf.save:1
wallpapershop nginx[31861]: nginx: configuration file  /etc/nginx/nginx.conf test failed
wallpapershop systemd[1]: nginx.service: Control process exited,  code=exited status=1
wallpapershop systemd[1]: Failed to start A high performance web server     and a reverse proxy server.
wallpapershop systemd[1]: nginx.service: Unit entered failed state.
wallpapershop systemd[1]: nginx.service: Failed with result 'exit-code'.
dpkg: error processing package nginx-full (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-full (<< 1.14.1-0+xenial0.1~) | nginx-light (<<   1.14.1-0+xenial0.1~) | nginx-extras (<< 1.14.1-0+xenial0.1~); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-full (>= 1.14.1-0+xenial0) | nginx-light (>=  1.14.1-0+xenial0) | nginx-extras (>= 1.14.1-0+xenial0); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.

У меня есть эти в файле mysites.conf:

upstream fastcgi_backend {
server   127.0.0.1:9000;
#server unix:/run/php/php7.2-fpm.sock;
}

server {
listen 80;
server_name wallpapershop.gr;
return 301 https://www.wallpapershop.gr$request_uri;
}

server {
listen 80 default_server;
server_name www.wallpapershop.gr; # dev.wallpapershop.com;
root   /home/wpaper/public_html;

#check http_x_forwarded_proto value that comes from load balancer
set $my_http "http";
set $my_ssl "off";
set $my_port "80";

if ($http_x_forwarded_proto = "https") {
  set $my_http "https";
  set $my_ssl "on";
  set $my_port "443";
}

#cut off port from url
port_in_redirect off;

#setup log files
access_log  /home/wpaper/www_logs/wpaper.access.log;
error_log /home/wpaper/www_logs/wpaper.error.log;

include includes/blocks.conf;

# Include Security rules for Mageto
include includes/security.conf;

# Tell browsers that website should olways be accessible via HTTPS
# add_header Strict-Transport-Security "max-age=15984000" always;

# Include redirects
include includes/redirects.conf;

# Include static
include includes/static.conf;



# Add rewrite for product feeds
location ~ ^/en/skroutzfeed\.xml {
    expires 24h;
    try_files /home/wpaper/public_html/skroutzfeed_en.xml /skroutzfeed_en.xml =404;
}
location ~ ^/el/skroutzfeed\.xml {
    expires 24h;
    try_files /home/wpaper/public_html/skroutzfeed_gr.xml /skroutzfeed_gr.xml =404;
}
location ~ ^/skroutzfeed\.xml {
    expires 24h;
    try_files /home/wpaper/public_html/skroutzfeed_gr.xml /skroutzfeed_gr.xml =404;
}
#include includes/phpmyadmin.conf;
#include includes/solr.conf;

#location ~ ^/el {
#    #set $magento_run_code "el";
#    #set $magento_run_type "store";
#}

#location ~ ^/en {
#    #set $magento_run_code "en";
#    #set $magento_run_type "store";
#}

location / {
    #expires 30d;
    index index.html index.php;
    set $magento_run_code "el";
    set $magento_run_type "store";
    try_files $uri $uri/ @handler;
}

location @handler {
    rewrite / /index.php;
}

#location = /js/index.php/x.js {
#    rewrite ^(.*\.php)/ $1 last;
#}

location ~ \.php {
    expires  off;
  # fastcgi_pass   fastcgi_backend;
    fastcgi_buffers 8 32k;
    fastcgi_buffer_size 64k;
    fastcgi_busy_buffers_size 64k;
    fastcgi_connect_timeout 3000s;
    fastcgi_read_timeout 3000s;
    fastcgi_send_timeout 3000s;
    fastcgi_param HTTPS $my_ssl;
    fastcgi_param REMOTE_ADDR $http_x_real_ip;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include fastcgi_params;
    fastcgi_param REMOTE_ADDR $http_x_real_ip;
}
}

Пока я проверял, у меня есть только эти строки:

upstream fastcgi_backend {
server   127.0.0.1:9000;
#server unix:/run/php/php7.2-fpm.sock;
}

Я сломал свой сайт. Кто-нибудь может помочь, пожалуйста?

-1
задан 18 November 2018 в 20:39
1 ответ

У вас был upstream fastcgi_backend , определенный дважды: в mysites.conf и в wallpapershop.gr.conf.save . Следовательно, вы получили сообщение об ошибке nginx: [emerg] duplicate upstream "fastcgi_backend" .

Удалив второй файл конфигурации (по совету Майкла Хэмптона), вы решили проблему.

1
ответ дан 5 December 2019 в 19:39

Теги

Похожие вопросы