From 54c558ccca89ea59015d982b678bcd0d0c797c82 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Sun, 3 Aug 2014 11:16:11 +0000 Subject: Split fastcgi socket path and document root option and add the SCRIPT_FILENAME CGI param with a prepended root. This fixes php-fpm that expects SCRIPT_FILENAME and also works with slowcgi if you configure the root correctly. For example, if SCRIPT_NAME and REQUEST_URI are /php/index.php, root is /htdocs, SCRIPT_FILENAME will be /htdocs/php/index.php. As tested and discussed with florian@ --- usr.sbin/httpd/server_file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/httpd/server_file.c') diff --git a/usr.sbin/httpd/server_file.c b/usr.sbin/httpd/server_file.c index 5985681acdd..4a906612dd6 100644 --- a/usr.sbin/httpd/server_file.c +++ b/usr.sbin/httpd/server_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_file.c,v 1.24 2014/08/02 09:54:13 reyk Exp $ */ +/* $OpenBSD: server_file.c,v 1.25 2014/08/03 11:16:10 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -148,7 +148,7 @@ server_file(struct httpd *env, struct client *clt) /* Request path is already canonicalized */ if ((size_t)snprintf(path, sizeof(path), "%s%s", - srv_conf->path, desc->http_path) >= sizeof(path)) { + srv_conf->root, desc->http_path) >= sizeof(path)) { /* Do not echo the uncanonicalized path */ server_abort_http(clt, 500, desc->http_path); return (-1); @@ -226,7 +226,7 @@ server_file_index(struct httpd *env, struct client *clt) /* Request path is already canonicalized */ if ((size_t)snprintf(path, sizeof(path), "%s%s", - srv_conf->path, desc->http_path) >= sizeof(path)) + srv_conf->root, desc->http_path) >= sizeof(path)) goto fail; /* Now open the file, should be readable or we have another problem */ -- cgit v1.2.3