Discussion:
HTTPD location index issue
(too old to reply)
R0me0 ***
2016-07-28 20:33:04 UTC
Permalink
Howdy !

I'm running OpenBSD 5.9 stable branch

I can't setup two different locations with different index files

Sample:


server "example.com"
listen on egress port 80
# Root path and directory index is already index.php
root "/htdocs/example.com"

location "/app/*.php" {
# setting new index for /app directory
directory index "index.php"
fastcgi socket "/run/php-fpm.sock"
}

Even configuring diferent locations / and /app and put index.html and
index.php respectively I can't to have the expected behavior.

Just able to set one or another not both.

Any ideas ?

Thanks in advance
R0me0 ***
2016-07-28 20:34:19 UTC
Permalink
diiff
< # Root path and directory index is already index.php
# Root path and directory index is already index.hml
Howdy !
I'm running OpenBSD 5.9 stable branch
I can't setup two different locations with different index files
server "example.com"
listen on egress port 80
# Root path and directory index is already index.php
root "/htdocs/example.com"
location "/app/*.php" {
# setting new index for /app directory
directory index "index.php"
fastcgi socket "/run/php-fpm.sock"
}
Even configuring diferent locations / and /app and put index.html and
index.php respectively I can't to have the expected behavior.
Just able to set one or another not both.
Any ideas ?
Thanks in advance
Alexander Hall
2016-07-28 21:00:30 UTC
Permalink
Post by R0me0 ***
Howdy !
I'm running OpenBSD 5.9 stable branch
I can't setup two different locations with different index files
server "example.com"
listen on egress port 80
# Root path and directory index is already index.php
root "/htdocs/example.com"
location "/app/*.php" {
I doubt location "/app/*.php" will match the /app directory itself.

/Alexander
Post by R0me0 ***
# setting new index for /app directory
directory index "index.php"
fastcgi socket "/run/php-fpm.sock"
}
Even configuring diferent locations / and /app and put index.html and
index.php respectively I can't to have the expected behavior.
Just able to set one or another not both.
Any ideas ?
Thanks in advance
R0me0 ***
2016-07-28 21:17:53 UTC
Permalink
Yes that's what I intend

I noticed directory index grammar just works out of location grammar and I
cant setup more than one time
Post by Alexander Hall
Post by R0me0 ***
Howdy !
I'm running OpenBSD 5.9 stable branch
I can't setup two different locations with different index files
server "example.com"
listen on egress port 80
# Root path and directory index is already index.php
root "/htdocs/example.com"
location "/app/*.php" {
I doubt location "/app/*.php" will match the /app directory itself.
/Alexander
Post by R0me0 ***
# setting new index for /app directory
directory index "index.php"
fastcgi socket "/run/php-fpm.sock"
}
Even configuring diferent locations / and /app and put index.html and
index.php respectively I can't to have the expected behavior.
Just able to set one or another not both.
Any ideas ?
Thanks in advance
R0me0 ***
2016-07-28 21:30:22 UTC
Permalink
Solved

location "/app/" { directory index index.php }

location "/app/*.php" { fastcgi socket "/run/php-fpm.sock" }

Thanks
Post by R0me0 ***
Yes that's what I intend
I noticed directory index grammar just works out of location grammar and I
cant setup more than one time
Post by Alexander Hall
Post by R0me0 ***
Howdy !
I'm running OpenBSD 5.9 stable branch
I can't setup two different locations with different index files
server "example.com"
listen on egress port 80
# Root path and directory index is already index.php
root "/htdocs/example.com"
location "/app/*.php" {
I doubt location "/app/*.php" will match the /app directory itself.
/Alexander
Post by R0me0 ***
# setting new index for /app directory
directory index "index.php"
fastcgi socket "/run/php-fpm.sock"
}
Even configuring diferent locations / and /app and put index.html and
index.php respectively I can't to have the expected behavior.
Just able to set one or another not both.
Any ideas ?
Thanks in advance
Loading...