OpenBSD httpd fastcgi “No such file or directory (500 Internal Server Error)”

In case it helps (because there’s no easy answer when you Google for this as of today)… if you are running OpenBSD 6.8 and have something like this in your /etc/httpd.conf pointing to a FastCGI service:

This will not work and you’ll get an 500 Internal Server Error error.

If you troubleshoot by say stopping httpd and then starting it via something like httpd -v -v -v -d (or you look at the logs in /var/www/logs/error.log – which didn’t give me anything initially, not sure why) you’ll find an entry like: No such file or directory (500 Internal Server Error).

Not very helpful but it looks like httpd can’t find the FastCGI service. The service is running and I can connect to it (e.g. do a telnet 3000).

So what’s the matter? The problem is that with OpenBSD 6.8 the syntax for fastcgi changed. To support non-localhost IPs the syntax has changed so that instead of fastcgi socket ":3000" you now have to specify fastcgi socket tcp 3000. Change the line in your config to the correct one and now it will work.

That’s all!