From 3282755c3798b695177c961a5745267cda6c21c4 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 12 Feb 2023 18:00:17 +0100 Subject: Completed and fixed FCGI environment variables --- plugins/fcgi/fcgi.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/fcgi/fcgi.cpp b/plugins/fcgi/fcgi.cpp index 95f03f6..74a495a 100644 --- a/plugins/fcgi/fcgi.cpp +++ b/plugins/fcgi/fcgi.cpp @@ -110,15 +110,18 @@ namespace { } env["PATH_INFO"] = c.GetRequestParam("rel_target"); - env["PATH_TRANSLATED"] = fs::path{c.GetRequestParam("rel_target")} / c.GetRequestParam("rel_target"); + env["PATH_TRANSLATED"] = fs::path{c.GetRequestParam("doc_root")} / c.GetRequestParam("rel_target"); env["QUERY_STRING"] = query; env["REMOTE_ADDR"] = ""; env["REMOTE_HOST"] = ""; env["REMOTE_IDENT"] = ""; env["REMOTE_USER"] = ""; env["REQUEST_METHOD"] = c.GetRequestParam("method"); + env["DOCUMENT_ROOT"] = c.GetRequestParam("doc_root"); + env["DOCUMENT_URI"] = target; env["REQUEST_URI"] = target; env["SCRIPT_NAME"] = c.GetRequestParam("target"); + env["SCRIPT_FILENAME"] = fs::path{c.GetRequestParam("doc_root")} / c.GetRequestParam("target"); env["SERVER_NAME"] = c.GetRequestParam("host"); env["SERVER_PORT"] = c.GetServerParam("port"); env["SERVER_PROTOCOL"] = c.GetRequestParam("http_version"); -- cgit v1.2.3