Welcome! Log In Create A New Profile

Advanced

Re: Fetching a string by parsing URL

July 22, 2015 07:31PM
For some reason, I'm getting it as null. This is my config file:

map $uri $last_path {
~*/(?<pathname>[^/]+)/?$ $pathname;
}

server {
listen 80;
root /basefolder;

error_page 500 501 502 503 504 = /error5x.html?name=$arg_name&path=$last_path;

location ~*/error5x.html? {
alias <static file location>/error5x.html;
}

location ~*/path1/ {

if (-f $document_root/error503.html) {
return 503;
}
....
}

However, if I update the location directive as below:

location ~*/error5x.html? {
alias <static file location>/error5x.html?name=$arg_name&path=$last_path;
}

I get a file not found error. But when I check the nginx log, I can see that it is fetching the $last_path variable. Just that it takes it as part of the file name and throws a 404 error.

Thanks.
Subject Author Posted

Fetching a string by parsing URL

sudharshanr July 22, 2015 12:43AM

Re: Fetching a string by parsing URL

Edho Arief July 22, 2015 12:56AM

Re: Fetching a string by parsing URL

sudharshanr July 22, 2015 02:17AM

Re: Fetching a string by parsing URL

unclepieman July 22, 2015 08:22AM

Re: Fetching a string by parsing URL

sudharshanr July 22, 2015 01:08PM

Re: Fetching a string by parsing URL

Edho Arief July 22, 2015 02:14PM

Re: Fetching a string by parsing URL

sudharshanr July 22, 2015 07:31PM

Re: Fetching a string by parsing URL

sudharshanr July 23, 2015 02:36PM

Re: Fetching a string by parsing URL

sudharshanr July 23, 2015 03:32PM

Re: Fetching a string by parsing URL

Francis Daly July 24, 2015 06:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 240
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