Nginx emerg no port in upstream php fpm

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

wodby / drupal-nginx Public archive

no port in upstream after restart #28

no port in upstream after restart #28

Comments

everything start fine except nginx dies with code exit 1
and gets this error message
nginx_1 | nginx: [emerg] no port in upstream «backend» in /etc/nginx/conf.d/drupal.conf:23

The text was updated successfully, but these errors were encountered:

The error is pretty clear, look up the definition of the backend upstream in your /etc/nginx/nginx.conf. Normally port should be 9000 by default unless you’ve overridden it with NGINX_BACKEND_PORT .

Читайте также:  Html display block javascript

Thank you for trying to help me out.
I am newbie on docker so don’t really know how it actually works.
The thing is it was working for like a month and after i shut down my mac it stopped working (and getting that error message from nginx)

after adding nginx backend host line I get this message nginx_1 | nginx: [emerg] host not found in upstream «drupal:9000» in /etc/nginx/nginx.conf:63

My docker-composer file.yml

services:
db:
image: wodby/drupal-mariadb
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal

command: —character-set-server=utf8mb4 —collation-server=utf8mb4_unicode_ci # The simple way to override the mariadb config.

volumes: - ./docker-runtime/mariadb:/var/lib/mysql 

— ./docker-runtime/mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.

php:
image: wodby/drupal-php:7.0 # Allowed: 7.0, 5.6.
environment:
PHP_SITE_NAME: docker-dev
PHP_HOST_NAME: localhost:8000
PHP_DOCROOT: drupal # Relative path inside the /var/www/html/ directory.
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
PHP_XDEBUG_ENABLED: 1 # Set 1 to enable.
volumes:
— ./:/var/www/html

nginx:
image: wodby/drupal-nginx
environment:
NGINX_SERVER_NAME: localhost
NGINX_UPSTREAM_NAME: php
NGINX_BACKEND_HOST: drupal
NGINX_DOCROOT: drupal # Relative path inside the /var/www/html/ directory.
DRUPAL_VERSION: 8 # Allowed: 7, 8.
volumes_from:
— php
ports:
— «8000:80»

pma:
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: db
PMA_USER: drupal
PMA_PASSWORD: drupal
PHP_UPLOAD_MAX_FILESIZE: 3G
PHP_MAX_INPUT_VARS: 3G
ports:
— «8001:80″`

Источник

Ошибка no port in upstream «php-fpm» (NGINX)?

не особо понятен, я почему-то не смог его найти. Что за htdocs? Может заменить на public_html, где и лежит сайт?

Средний 2 комментария

kotomyava

В fastcgi_pass, должно быть, либо указание блок upstream<>(https://nginx.ru/ru/docs/http/ngx_http_upstream_mo. либо unix:/path/to/socket(путь до сокета), либо ipaddress:port(адрес/порт)
В приведённом вами конфиге, было вероятно, первое. Но в свою конфиг вы его вставить забыли.

fastcgi_param SCRIPT_FILENAME у вас задан через переменные, и вероятно подойдёт.

kotomyava

Нет. Это же пример просто.
Вам, на самом деле, надо в fastcgi_pass написать адрес/порт, или путь до сокета, на котором у вас висит php-fpm.
upstream вам не нужен — он применяется тогда, когда надо обеспечить обработку на нескольких серверах, прежде всего.

Для того, чтобы знать, что именно написать, надо посмотреть в конфиг пула php-fpm, который должен обрабатывать запросы.

А вообще, судя по всему, вам надо серьёзно разобраться в том, что вы делаете, или лучше обратиться к тому, кто в этом разбирается.

Борис Сёмов, Вот в /etc/php/7.0/fpm/pool.d лежит my_site.ru.conf
В файле есть такой кусочек:
listen = /var/run/php/my_site.ru.sock
Указал вот так
fastcgi_pass unix:/var/run/php/my_site.ru.sock;
Ошибка осталась.

А вообще, судя по всему, вам надо серьёзно разобраться в том, что вы делаете, или лучше обратиться к тому, кто в этом разбирается.

Это да. Обратиться пока нет возможности, приходится все самому, вместе с гуглом. Глядишь и научусь чему-нибудь)

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx: [emerg] no port in upstream «www0» in /etc/nginx/php_fpm_status_vhost.con #158

nginx: [emerg] no port in upstream «www0» in /etc/nginx/php_fpm_status_vhost.con #158

Comments

I am attempting to update my server with a newer version of Perusio’s config and I was getting this error «nginx: [emerg] no port in upstream «www0″ in /etc/nginx/php_fpm_status_vhost.conf»

I replaced php_fpm_status_vhost.conf with the older version that I had and the error went away. The difference in the two files is that the old file (the one that works) has «fastcgi_pass phpcgi;» while the new file (with error) has «fastcgi_pass www0;»

Can someone explain to me the what is happening and what I need to do to fix it?

The text was updated successfully, but these errors were encountered:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastcgi_pass php; leads to ‘no port in upstream «php»‘ #155

fastcgi_pass php; leads to ‘no port in upstream «php»‘ #155

Comments

Information

Details

Description

# fastcgi settings fastcgi_pass php; 

is set but no upstream is defined:
nginx: [emerg] no port in upstream «php» in /etc/nginx/nginxconfig.io/php_fastcgi.conf:8

However if you add a backup server under Global config > PHP the upstream will defined in /etc/nginx/nginx.conf :

Steps to reproduce

e.g. even the default config does not add the socket (currently 7.2): https://www.digitalocean.com/community/tools/nginx

nginx -t && sudo systemctl reload nginx nginx: [emerg] no port in upstream "php" in /etc/nginx/nginxconfig.io/php_fastcgi.conf:8 

Expected behavior

according to the changes when you add a backup server I guess I’d expect this:

though I just went with: fastcgi_pass unix:/run/php/php7.4-fpm.sock;

Screenshots

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью