> On 11 Apr 2018, at 10:00, Gregory Edigarov <ediga...@qarea.com> wrote:
> 
> On 10.04.18 22:24, Mischa wrote:
>> Hi All,
>> 
>> Is there a way to serve both static and dynamic content, eg. index.html and 
>> index.php within the same server { } definition?
>> I am looking for something like:
>> 
>> server "default" {
>>    listen on $ext_addr port 80
>>    root "/htdocs"
>>    directory index "index.html" # not needed as it's the default
>>    location "/files/*" {
>>        root "/htdocs/files"
>>        directory auto index
>>    }
>>    location "^/phpapp/*" {
>>        root "/htdocs/phpapp"
>>        directory index "index.php"
>>        fastcgi socket "/run/php-fpm.sock"
>>    }
>> }
>> 
>> Is it possible at all or do I need split static and dynamic content based on 
>> server { }?
>> 
> Seems like it should work exactly as you have written.
> if not you should show more then you've shown.

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. :((

Mischa


Reply via email to