HTTPD directory index

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTPD directory index

Patrick Dohman-4
Hoping to clarify if OpenBSD HTTPD supports index.html & index.php simultaneously?
The following config appears to be supported:

# A minimal default server
server "default" {
        listen on $ext_addr port 80
        directory { index "index.html" }
        location "/*.php*" {
        root { "/htdocs" }
        fastcgi socket "/run/php-fpm.sock"}

However different varieties of the following directive:

directory { index “index.html”, index “index.php”} or { index “index.html”, “index.php”}

Results in either a successful reload or the following syntax error:

httpd[35299]: parent_sig_handler: reload requested with SIGHUP
httpd[35299]: /etc/httpd.conf:20: syntax error
httpd[35299]: no actions, nothing to do

Regards
Patrick

Reply | Threaded
Open this post in threaded view
|

Re: HTTPD directory index

Stuart Henderson
On 2019-10-13, Patrick Dohman <[hidden email]> wrote:
> Hoping to clarify if OpenBSD HTTPD supports index.html & index.php simultaneously?

From a quick look at manual and code (I don't use httpd other than for
testing) - you can set a different index in each location block, but you
can only use one filename each time, there is no fallback to a second
file if the first doesn't exist.


Reply | Threaded
Open this post in threaded view
|

Re: HTTPD directory index

paul wisehart
On Wed, Oct 16, 2019 at 08:17:38AM -0000, Stuart Henderson wrote:
> On 2019-10-13, Patrick Dohman <[hidden email]> wrote:
> > Hoping to clarify if OpenBSD HTTPD supports index.html & index.php simultaneously?
>
> From a quick look at manual and code (I don't use httpd other than for
> testing) - you can set a different index in each location block, but you
> can only use one filename each time, there is no fallback to a second
> file if the first doesn't exist.

I use httpd a lot, and this is how I understand it.
I had tried getting it to work, but in hindsight I never missed it.