Welcome! Log In Create A New Profile

Advanced

Bounty: SSI module variable implementation

Posted by maarten00 
Bounty: SSI module variable implementation
November 17, 2015 10:00AM
We have recently migrated from a server with Apache to an nginx server, but we are running into problems with the current implementation of SSI in nginx. Specifically, the problem we have is that the DOCMENT_NAME variable is currently missing. Here I can see that it is listed as a todo:
https://github.com/nginx/nginx/blob/master/src/http/ngx_http_variables.c#L143

We are looking for someone to implement this variable for us. Payment or a donation is negotiable.
Re: Bounty: SSI module variable implementation
November 17, 2015 10:22AM
Have you tried something like:

scgi_param DOCUMENT_NAME $document_root;
fastcgi_param DOCUMENT_NAME $document_root;

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Bounty: SSI module variable implementation
November 20, 2015 02:54AM
Thanks for your help, I have asked my host to try if this works for us. The solution they finally came up with that seems to work is this:

if ($request_uri ~ /([^/?]+)(\?[^?]+)?$) {
set $document_name $1;
}



Edited 1 time(s). Last edit at 11/20/2015 02:55AM by maarten00.
Re: Bounty: SSI module variable implementation
November 20, 2015 03:51AM
Good to know, but invest some time to convert this into a map (https://www.google.nl/#q=nginx+map+regex) because even-though 'if' is very powerful it should only be used to stop handling a request.

if (...) { return ... } is ok because the location block exits.

if (...) { set x y; set a b; ... } is not ok because in some weird cases 'set a b' can run before 'set x y'.

Just doing a 'set' (with values from map) is ok.

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 129
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready