Working example for Nginx with php8?
Closed this issue · 6 comments
EinHecki commented
Hi, is there any fully working docker-compose example for nginx with php8?
daohoangson commented
The latest is still php7. If you need php8 then consider the PR #24. But it's not completed though.
EinHecki commented
Okay, I now changed my docker-compose.yml
to this:
version: '3.9'
services:
src:
image: alpine
command: ["uptime"]
volumes:
- .:/var/www/html
php-fpm:
image: xfrocks/xenforo:php-fpm
volumes_from:
- src
nginx:
image: xfrocks/xenforo:nginx
environment:
- VIRTUAL_HOST=localhost
expose:
- "80"
links:
- php-fpm
volumes_from:
- src
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
But I'm getting a 502 Bad Gateway error
. Atm I'm trying this on my local Windows machine
NoNamePro0 commented
I also receive a 502
http code with the same docker-compose on a latest Arch Linux distribution.
Docker logs shows:
nginx-proxy_1 | nginx.1 | 2021/05/26 17:49:57 [error] 70#70: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.20.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.20.0.4:80/", host: "localhost"
EinHecki commented
Anything new?
daohoangson commented
You need to set env var NGINX_FAST_CGI_PASS=php-fpm:9000
, take a look into https://github.com/xfrocks/docker-xenforo/blob/master/examples/docker-compose.yml
EinHecki commented
Found out myself, but thanks a lot! ^^