Welcome! Log In Create A New Profile

Advanced

Re: nginx custom error_page

May 08, 2010 04:56AM
On Sat, May 08, 2010 at 12:29:29AM -0400, kleinchris wrote:

> Hello, I wanted to set a custom error_page by setting up:
> if (!-e $request_filename) {
> rewrite ^/de/(.*)$ /de/vbseo.php last;
> }
> if (!-e means if the requestes file don't exists right?!
>
> nginx server 0.8.32
>
> Here is my config: http://pastebin.com/2krFJ3sf

location / {
index index.php index.html index.htm;
}

location ~ ^(?<script>.+\.php)(?<path_info>/.+)?$ {

try_files $script =404;

limit_req zone=antiddos burst=5 nodelay;

include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/fastcgi/www-data.php.socket;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_NAME $script;
}

location ~ ^/de/(?<sitemap>(urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ {
limit_req zone=antiddos burst=5 nodelay;

include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/fastcgi/www-data.php.socket;
fastcgi_param SCRIPT_FILENAME
$document_root/de/vbseo_sitemap/vbseo_getsitemap.php;
fastcgi_param QUERY_STRING sitemap=$sitemap;
fastcgi_param SCRIPT_NAME /de/vbseo_sitemap/vbseo_getsitemap.php;
}

location /de/ {
index index.php index.html index.htm;

try_files $uri $uri /de/vbseo.php;
}


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx custom error_page

kleinchris May 08, 2010 12:29AM

Re: nginx custom error_page

kleinchris May 08, 2010 01:03AM

Re: nginx custom error_page

Igor Sysoev May 08, 2010 04:56AM

Re: nginx custom error_page

Igor Sysoev May 08, 2010 04:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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