I'm having a reverse-proxied Nginx server. I wanted to know if it is possible to redirect the request in Nginx based on the content-type of the request? Right now, I'm checking the URL for a keyword, and based on that, I redirect the request. So it is something like this: location ~*/(keyword){ proxy_pass http://127.0.0.1:6565; } But now I have another URL having the same kby sudharshanr - Nginx Mailing List - English
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 /Desktop/error5x.html; } location ~*/path1/ { if (-f $document_root/error503.html) { retuby sudharshanr - Nginx Mailing List - English
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 /Desktop/error5x.html; } location ~*/path1/ { if (-f $document_root/error503.html) { retuby sudharshanr - Nginx Mailing List - English
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; } locatiby sudharshanr - Nginx Mailing List - English
I think I need to rephrase my question. Right now, my nginx.conf looks like this: location ~*/path1/{ if (-f $document_root/error503.html) { return 503; } } error_page 503 <path_to_static_file>?arg1=$arg_queryparam1&arg2=<last path from url> As you can see, if there is a 503 error, then I return a static file. The arguments to the static file are: 1. the param from urby sudharshanr - Nginx Mailing List - English
Edho Arief: Thanks, but I think I need to rephrase my question. Right now, my nginx.conf looks like this: location ~*/path1/{ if (-f $document_root/error503.html) { return 503; } } error_page 503 <path_to_static_file>?arg1=$arg_queryparam1&arg2=<last path from url> Aby sudharshanr - Nginx Mailing List - English
I have a web server sitting behind Nginx. If there is an error, then I want to fetch some information from the url and pass it on to a static file as parameters. I have configured Nginx to fetch the query parameters from the url using $arg_param_name. However, I also need to fetch a String from the url path itself. For instance, if the url is "www.website.com/path1/path2?arg1=val&arg2by sudharshanr - Nginx Mailing List - English
Valentin V. Bartenev Wrote: ------------------------------------------------------- > On Thursday 11 December 2014 00:33:24 sudharshanr wrote: > > Hi, > > > > I'm using nginx 1.6.2 on Amazon ec2 linux server. The problem I'm > having is > > that all my 404 errors are going to my access.log. I want them to be > > redirected to error.log instead. > &gby sudharshanr - Nginx Mailing List - English
Hi, I'm using nginx 1.6.2 on Amazon ec2 linux server. The problem I'm having is that all my 404 errors are going to my access.log. I want them to be redirected to error.log instead. I saw on other forums that with nginx 1.7+, I can use the if directive of access_log to do something like: map $status $errorable { ~([^23][0-9][0-9]) 1; default 0; } access_logby sudharshanr - Nginx Mailing List - English
![]() |
![]() |
![]() |
![]() |
![]() |