Running XtraUpload Under Nginx

Nginx rewrite rules for XtraUpload:

if (!-e $request_filename) {
# New Rewrite Rules for total site SEO
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/index\.htm$ /$1.php?$2=$3&$4=$5&$6=$7&$8=$9&$10=$11 last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/index\.htm$ /$1.php?$2=$3&$4=$5&$6=$7&$8=$9 last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/index\.htm$ /$1.php?$2=$3&$4=$5$6=$7& last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/index\.htm$ /$1.php?$2=$3&$4=$5 last;
rewrite ^/(.*)/(.*)_(.*)/index\.htm$ /$1.php?$2=$3 last;

# More New Rewrite Rules for total site SEO, with index.htm pagess at the end
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/$ /$1.php?$2=$3&$4=$5&$6=$7&$8=$9&$10=$11 last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/$ /$1.php?$2=$3&$4=$5&$6=$7&$8=$9 last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/(.*)_(.*)/$ /$1.php?$2=$3&$4=$5$6=$7& last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*)/$ /$1.php?$2=$3&$4=$5 last;
rewrite ^/(.*)/(.*)_(.*)/$ /$1.php?$2=$3 last;

# Old rewrite rules for Files
rewrite ^/file/(.*)/(.*)$ /index.php?p=download&link=$1&name=$2 last;
rewrite ^/files/(.*)/(.*)$ /index.php?p=download&link=$1&name=$2 last;
rewrite ^/files/(.*)$ /index.php?p=download&hash=$1 last;
rewrite ^/download/(.*)$ /index.php?p=get&file=$1 last;

# Old Rewrite rules for direct imaging
rewrite ^/imagedirect/(.*)$ /imagedirect.php?file=$1 last;
rewrite ^/thumb/(.*)$ /thumb.php?file=$1 last;
break;
}

Post a Comment

Your email is never published nor shared. Required fields are marked *