fastcgi does not work
See original GitHub issueI am unable to get this to work via fastcgi with a simple php-fpm container. Here’s my docker-compose.yml
file:
version: "3"
services:
proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
environment:
- DEFAULT_HOST=test.local
fpm:
image: php:fpm
environment:
- VIRTUAL_HOST=test.local
- VIRTUAL_PROTO=fastcgi
I then drop in a simple index.php
file by running:
docker container exec -it web_fpm_1 /bin/bash -c 'echo "<?php phpinfo(); ?>" > /var/www/html/index.php'
(It puts web_
in front because this project is in a directory named web/
.)
I also modify my hosts
file to point test.local
to 127.0.0.1
, so I can test it.
However, every attempt to browse to test.local
results in a blank white page.
The logs for the web_fpm_1
container show that nothing gets sent except a 200 response:
[06-Jul-2020 15:40:39] NOTICE: fpm is running, pid 1
[06-Jul-2020 15:40:39] NOTICE: ready to handle connections
172.19.0.3 - 06/Jul/2020:15:41:02 +0000 "- " 200
172.19.0.3 - 06/Jul/2020:15:41:03 +0000 "- " 200
What am I doing wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (5 by maintainers)
Top Results From Across the Web
Resolve FastCGI Issues | Media Temple Community
If you have enabled PHP to run as FastCGI on your DV server 4.0 or VPS server, this article may help you resolve...
Read more >php - fastcgi does not work - wrapper dowloaded not run
So If I access website it gives it random name and when I look at downloaded contents it shows php5-fcgi contents. When I...
Read more >PHP 7.2 fastcgi doesn't work on Ubuntu 18.04 server
I don't advise to use libapache2-mod-fastcgi module in Bionic or newer distro. Apache2 provides mod_proxy_fcgi module that proxies fcgi requests ...
Read more >Issue - php fastcgi is not working = 500 (fpm works)
Hi, If I switch from php-fpm(7.2.14) to php-fastCGi i get ERROR 500. The Log shows me mod_fcgid: stderr: PHP Fatal error: Uncaught ...
Read more >nginx + php-fastcgi: fastcgi suddenly not working - Linode
Does the www user have write access to the PID file? What do you get when you manually run the spawn-fcgi program as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Based on the example by @flowl I have implemented https://github.com/tkw1536/nginx-proxy-fpm-workaround. This solution does not require manually intervening in the
nginx-proxy
container. It additionally serves non-php files statically.@tkw1536 in the config is no
try_files $uri $uri/ /index.php
and infastcgi_params
or the default.conf there is nofastcgi_param SCRIPT_FILENAME $request_filename;