On Mon, Jan 15, 2018 at 02:18:07PM +0100, Hidvégi Gábor wrote:
> >Synopsis: pre defined macros don't work in 'fastcgi socket' configuration
> >line
> >Category: httpd
> >Environment:
> System : OpenBSD 6.2
> Details : OpenBSD 6.2 (GENERIC) #132: Tue Oct 3 21:18:21 MDT 2017
>
> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC
>
> Architecture: OpenBSD.amd64
> Machine : amd64
> >Description:
>
> I cannot use a macro as a parameter of 'fastcgi socket'. This problem is not
> AMD64 only, works on ARM too (cubieboard).
>
> >How-To-Repeat:
>
> In httpd.conf I define the macro:
> php="/data/run/php-fpm.sock"
>
> Later when I try to use it:
> location "*.php" {
> fastcgi socket $php
> }
>
> Running 'httpd -n' returns '/etc/httpd.conf:21: syntax error' (of course on
> the fastcgi line). When I replace to 'fastcgi socket
> "/data/run/php-fpm.sock"' it works.
>
> >Fix:
>
> It might be either httpd or documentation error (cannot use macros
> everywhere).
Not the prettiest solution but since a string is expected you have to
quote the value:
$ cat httpd.conf
php="\"/data/run/php-fpm.sock\""
server "foo" {
listen on * port 80
location "*.php" {
fastcgi socket $php
}
}
$ httpd -n -f httpd.conf
configuration OK