> On 11 Apr 2018, at 12:14, Gregory Edigarov <[email protected]> wrote:
>
> On 11.04.18 11:40, Mischa wrote
>> Ok, good to know. It doesn't work as written. The only thing I see in the
>> error.log is the fact that the PHP script is not found.
>>
>> Access to the script '/htdocs/s/' has been denied (see
>> security.limit_extensions)
>>
>> Which tells me index.php is not requested.
>>
>> Browser tells me: File not found
>>
>> Running in debug mode it shows the following
>>
>> default 46.xx.xx.xx - - [11/Apr/2018:10:24:26 +0200] "GET /s/ HTTP/1.1" 404
>> 0 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101
>> Firefox/58.0"
>> default 46.xx.xx.xx - - [11/Apr/2018:10:24:27 +0200] "<UNKNOWN> " 408 0 "" ""
>> server default, client 1 (1 active), 46.xx.xx.xx:4824 -> xx.xx.xx.xx,
>> timeout (408 Request Timeout)
>> Primary script unknown
>> default 46.xx.xx.xx - - [11/Apr/2018:10:24:27 +0200] "GET /s/ HTTP/1.1" 404
>> 0 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101
>> Firefox/58.0"
>>
>> Not sure what else to look at. :((
> Did some tests.
> here's how it works:
>
> location "/test" {
> block return 301 "/test/"
> }
> location "/test/" {
> root strip 1
> root "/htdocs/phpapp"
> directory index "test.php"
> }
>
> note "root strip 1" directive.
I had tried with strip 1 as well, it seems problem is with: fastcgi socket
"/run/php-fpm.sock"
The working end result is something like:
server "default" {
listen on $ext_addr port 80
root "/htdocs/default"
location "^/phpapp/*" {
root { "/htdocs/phpapp", strip 1 }
directory index "index.php"
}
location match "^/phpapp/[%l%u%d]+$" {
root "/htdocs/phpapp/index.php"
fastcgi socket "/run/php-fpm.sock"
}
location "/*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
}
Thank you very much for your response and testing. Really appreciate it.
Mischa