Wpis z mikrobloga

Siemano mirasy mam niemały problem z nginxem i #docker. Otóż, chcę wywołać skrypt w php, który wykona echo i wyświetli mi na stronie napis "dupa". Problem w tym, że gdy wchodzę na lokalizację gdzie powinien znajdować się dany plik dostaję An error occurred.

Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Dodatkowo nginx wypluwa connect() failed (111: Connection refused) while connecting to upstream, client: 172.21.0.1, server: 127.0.0.1, request: "GET /dd.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080"
Konfiguracja default na nginxa:

server {
listen 80;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

root /usr/share/nginx/html;

location / {
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass [http://127.0.0.1](http://127.0.0.1);
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

Czy jest ktoś mi w stanie pomóc?
#nginx #linux #docker #devops
  • 5
@devopsiarz: docker-compose:

version: '3'

services:
#php
phpapplication:
build:
context: ./
dockerfile: app.docker

#webserver
webserv:
build:
context: ./
dockerfile: web.docker
ports:
- "8080:80"

depends_on:
- phpapplication

app.docker:

FROM php:7.2-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
@TMBRK: Domyślnie PHP-FPM słucha na sockecie. Przynajmniej na deb/ubuntu

~# grep 'listen =' /etc/php/7.2/fpm/pool.d/www.conf

listen = /run/php/php7.2-fpm.sock

^ Na świeżo zainstalowanym php-fpm
grep 'listen =' /etc/php/7.2/fpm/pool.d/www.conf


@iMonkey: grep: /etc/php/7.2/fpm/pool.d/www.conf: No such file or directory
dodatkowo, nginx oraz php-fpm są na osobnych kontenerach