S
S
stefan_hansch2017-01-10 09:09:06
PHP
stefan_hansch, 2017-01-10 09:09:06

When reloading nginx, error duplicate upstream "php-fpm" in /etc/nginx/common/upstream:2?

Hello.
A website (php) is running on a remote ubuntu server. With nginx settings along the path nginx/sites-available/default. You need to set up and run another site (php, laravel) on the same server. To do this, I created another server block in the nginx settings, similar to default, only changed the port.
/etc/nginx/sites-available/laravel

server
{
        listen 81;
        server_name domain.com ;
        root        /var/www/laravel/www/public;
        access_log  /var/www/laravel/logs/access.log;
        error_log  /var/www/laravel/logs/error.log;

        client_max_body_size            100m;

        index index.php index.html index.htm;

        location ^~ /upload/ {}

        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        location ~* ^.+.(js|css|png|jpg|jpeg|gif|ico)$ {
                access_log        off;
                expires           max;
        }

        location ~ \.php$ {
              #fastcgi_split_path_info ^(.+\.php)(/.+)$;
              #fastcgi_pass 127.0.0.1:9007;
              #fastcgi_index index.php;
              #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              #include fastcgi_params;
                include common/php-fpm;

}

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location ~ /\.ht {
                deny  all;
        }

        #
        #sendfile off;
}

I reload nginx with the nginx -s reload command. nginx error : [emerg] duplicate upstream "php-fpm" in /etc/nginx/common/upstream:2
/etc/nginx/common/upstream
upstream php-fpm
{
        server unix:/var/run/php5-fpm.sock;
}
upstream fcgiwrap
{
        server unix:/var/run/fcgiwrap.socket;
}

It is not entirely clear why the duplicate and how to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
neol, 2017-01-10
@stefan_hansch

This means that the same upstream is set somewhere else, or /etc/nginx/common/upstream is included several times.
You can search like this:
grep -r upstream /etc/nginx

W
Wexter, 2017-01-10
@Wexter

In some other config, you already have an upstream defined with this name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question