AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / Perguntas / 940605
Accepted
G. G.
G. G.
Asked: 2018-11-19 10:39:57 +0800 CST2018-11-19 10:39:57 +0800 CST 2018-11-19 10:39:57 +0800 CST

Urgent Nginx quebrou após atualização no servidor Ubuntu

  • 772

Tentei antes atualizar o Nginx de 1.14 para 1.14.1. Mas no apt-get upgrade eu obtive:

mysite systemd[1]: Starting A high performance web server and a        reverse proxy server...
mysite nginx[31861]: nginx: [emerg] duplicate upstream  "fastcgi_backend" in /etc/nginx/sites-enabled/mysite.conf.save:1
mysite nginx[31861]: nginx: configuration file  /etc/nginx/nginx.conf test failed
mysite systemd[1]: nginx.service: Control process exited,  code=exited status=1
mysite systemd[1]: Failed to start A high performance web server     and a reverse proxy server.
mysite systemd[1]: nginx.service: Unit entered failed state.
mysite 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.

Eu tenho isso no arquivo mysites.conf:

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

server {
listen 80;
server_name mysite.com;
return 301 https://www.example.com$request_uri;
}

server {
listen 80 default_server;
server_name www.example.com; # dev.www.example.com;
root   /home/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/www_logs/access.log;
error_log /home/www_logs/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/public_html/skroutzfeed_en.xml /skroutzfeed_en.xml =404;
}
location ~ ^/el/skroutzfeed\.xml {
    expires 24h;
    try_files /home/public_html/skroutzfeed_gr.xml /skroutzfeed_gr.xml =404;
}
location ~ ^/skroutzfeed\.xml {
    expires 24h;
    try_files /home/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;
}
}

Como verifiquei, tenho apenas essas linhas:

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

Eu quebrei meu site. Alguém pode ajudar por favor?

ubuntu
  • 1 1 respostas
  • 1069 Views

1 respostas

  • Voted
  1. Best Answer
    digijay
    2018-11-19T12:33:11+08:002018-11-19T12:33:11+08:00

    Você upstream fastcgi_backenddefiniu duas vezes: in mysites.confe in wallpapershop.gr.conf.save. Daí você recebeu a mensagem de erro nginx: [emerg] duplicate upstream "fastcgi_backend".

    Ao remover o segundo arquivo de configuração (conforme recomendado por Michael Hampton), você resolveu o problema.

    • 1

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve