I'm having some difficulty switching completely to OpenBSD httpd, and getting my
httpd.conf correctly serving
domain.tld/app requests from its
location.
The PHP app resides in
/var/www/app but
domain.tld/app requests return a
404 not found error.
This is my full
httpd.conf. I've tried a number of different syntaxes for this but have only been successful when creating a new
server "app.domain.tld" serving requests from
root "/var/www/app", but would prefer being able to reach this app at
/app.
Code:
server "domain.tld" {
alias www.domain.tld
listen on * port 80
listen on * tls port 443
directory index index.php
tls {
key "/etc/ssl/private/domain.tld.key"
certificate "/etc/ssl/domain.tld.fullchain.pem"
}
connection max request body 5000000000
location "/*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
location "/app*" {
root "/app"
}
location "/.well-known/acme-challenge/*" {
root "/acme"
root strip 2
}
}
server "cloud.domain.tld" {
listen on * tls port 443
root "/cloud/"
directory index index.php
tls {
key "/etc/ssl/private/domain.tld.key"
certificate "/etc/ssl/domain.tld.fullchain.pem"
}
hsts
location "/db_structure.xml" { block }
location "/.ht*" { block }
location "/README" { block }
location "/data*" { block }
location "/config*" { block }
location "/*.php*" {
fastcgi socket "/run/php-fpm.sock"
}
}