Forum

Questions and discussions

Nginx configuration required

Script's setup and configuration

Nginx configuration required

Postby volts » Fri Apr 26, 2013 8:22 am

Hello team!

I'm forced to move project to another host, and I couldn't get it to work under Nginx.
The main problem is in rewrite rules, I'm getting home page no matter page I visit.
Can you please help with a correct configuration file with rewrite rules for Nginx setup?
Thank you a much

Here is a my Nginx config based on .htaccess provided with photostorescript:
server {
listen 80;
server_name project.com;
root /var/www/project;
access_log /var/log/nginx/project.access.log;
error_log /var/log/nginx/project.error.log error;
index index.php;

location /category {
rewrite ^/category\/([0-9a-z-]+).html$ /index.php?category=$1 break;
rewrite ^/category\/([a-z]+)\/([0-9a-z-]+).html$ /index.php?category=$2&vd=$1 break;
}

location /catalog {
rewrite ^/catalog\/([0-9a-z-]+).html$ /index.php?catalog=$1 break;
}

location /photo {
rewrite ^/photo\/([0-9a-z-]+).html$ /index.php?catalog=$1&ctypes=photo break;
}

location /video {
rewrite ^/video\/([0-9a-z-]+).html$ /index.php?catalog=$1&ctypes=video break;
}

location /audio {
rewrite ^/audio\/([0-9a-z-]+).html$ /index.php?catalog=$1&ctypes=audio break;
}

location /files {
rewrite ^/files\/([0-9a-z-]+).html$ /index.php?catalog=$1&ctypes=files break;
}

location /news {
rewrite ^/news\/([0-9]+)\/*$ /news/?id=$1 break;
}

location /pages {
rewrite ^/pages\/([0-9a-z-]+).html$ /members/page.php?id=$1 break;
}

location /users {
rewrite ^/users\/([0-9a-z-]+).html$ /members/user.php?user=$1 break;
}

location /model {
rewrite ^/model\/([0-9a-z-]+).html$ /members/model.php?model=$1 break;
}

location /blog {
rewrite ^/blog\/([0-9a-z-]+).html$ /members/user_blog.php?user=$1 break;
rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog.php?user=$2&category=$1 break;
rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog.php?user=$3&ayear=$1&amonth=$2 break;
}
....
volts
 
Posts: 6
Joined: Wed Jun 27, 2012 4:13 pm

Re: Nginx configuration required

Postby vetinary » Wed Nov 12, 2014 12:15 pm

Hope this may help someone trying to use the script with Nginx. Put these locations within the server section of your domain config:

Code: Select all
   location /category {   
      rewrite ^/category\/([0-9a-z-]+).html$ /index.php?category=$1 last;
      rewrite ^/category\/([a-z]+)\/([0-9a-z-]+).html$ /index.php?category=$2&vd=$1 last;
   }

   location /stock-photo {
      rewrite ^/stock-photo\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=photo last;
   }

   location /stock-video {
      rewrite ^/stock-video\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=video last;
   }

   location /stock-audio {
      rewrite ^/stock-audio\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=audio last;
   }

   location /stock-vector {
      rewrite ^/stock-vector\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=files last;
   }

   location /news {
      rewrite ^/news\/([0-9]+)\/*$ /news/?id=$1 last;
   }
   location /pages {
      rewrite ^/pages\/([0-9a-z-]+).html$ /members/page.php?id=$1 last;
   }
   location /users {
      rewrite ^/users\/([0-9a-z-]+).html$ /members/user.php?user=$1 last;
   }
   location /model {
      rewrite ^/model\/([0-9a-z-]+).html$ /members/model.php?model=$1 last;
   }
   
   location /blog {
      rewrite ^/blog\/([0-9a-z-]+).html$ /members/user_blog.php?user=$1 last;
      rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog.php?user=$2&category=$1 last;
      rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog.php?user=$3&ayear=$1&amonth=$2 last;
   }

   location /post {
      rewrite ^/post\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog_post.php?user=$1&postid=$2 last;
   }

   location /testimonials {
      rewrite ^/testimonials\/([0-9a-z-]+).html$ /members/user_testimonials.php?user=$1 last;
   }
   location /friends {
      rewrite ^/friends\/([0-9a-z-]+).html$ /members/user_friends.php?user=$1 last;
   }

   location /static {
      rewrite ^/static([0-9]*)\/preview([0-9]*)\/[0-9a-z-]+-([0-9]+).(jpg|jpeg|flv|swf|wmv|mp4|mp3|mov)$ /content$1/$3/thumb$2.$4 last;
   }
   
   location /lightbox {
      rewrite ^/lightbox\/[0-9a-z-]+-([0-9]+).html$ /index.php?lightbox=$1 last;
   }
vetinary
 
Posts: 2
Joined: Wed Nov 12, 2014 8:46 am

Re: Nginx configuration required

Postby admin » Wed Dec 21, 2016 7:28 pm

Updated nginx config for the 16.11 version:

Code: Select all
   location /category {   
      rewrite ^/category\/([0-9a-z-]+).html$ /index.php?category=$1 last;
      rewrite ^/category\/([a-z]+)\/([0-9a-z-]+).html$ /index.php?category=$2&vd=$1 last;
   }

   location /stock-photo {
      rewrite ^/stock-photo\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=photo last;
   }

   location /stock-video {
      rewrite ^/stock-video\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=video last;
   }

   location /stock-audio {
      rewrite ^/stock-audio\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=audio last;
   }

   location /stock-vector {
      rewrite ^/stock-vector\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=files last;
   }

   location /news {
      rewrite ^/news\/([0-9]+)\/*$ /news/?id=$1 last;
   }
   location /pages {
      rewrite ^/pages\/([0-9a-z-]+).html$ /members/page.php?id=$1 last;
   }
   location /users {
      rewrite ^/users\/([0-9a-z-]+).html$ /members/user.php?user=$1 last;
   }
   location /model {
      rewrite ^/model\/([0-9a-z-]+).html$ /members/model.php?model=$1 last;
   }
   
   location /blog {
      rewrite ^/blog\/([0-9a-z-]+).html$ /members/user_blog.php?user=$1 last;
      rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog.php?user=$2&category=$1 last;
      rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog.php?user=$3&ayear=$1&amonth=$2 last;
   }

   location /post {
      rewrite ^/post\/([0-9a-z-]+)\/([0-9a-z-]+).html$ /members/user_blog_post.php?user=$1&postid=$2 last;
   }

   location /testimonials {
      rewrite ^/testimonials\/([0-9a-z-]+).html$ /members/user_testimonials.php?user=$1 last;
   }
   location /friends {
      rewrite ^/friends\/([0-9a-z-]+).html$ /members/user_friends.php?user=$1 last;
   }

   location /static {
      rewrite ^/static([0-9]*)\/preview([0-9]*)\/[0-9a-z-]+-([0-9]+).(jpg|jpeg|flv|swf|wmv|mp4|mp3|mov)$ /content$1/$3/thumb$2.$4 last;
   }
   
   location /lightbox {
      rewrite ^/lightbox\/[0-9a-z-]+-([0-9]+).html$ /index.php?lightbox=$1 last;
   }

location /canvas-print { rewrite ^/canvas-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /print { rewrite ^/print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /metal-print { rewrite ^/metal-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /framed-print { rewrite ^/framed-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /acrylic-print { rewrite ^/acrylic-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /greeting-card { rewrite ^/greeting-card\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /iphone-case { rewrite ^/iphone-case\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /galaxy-case { rewrite ^/galaxy-case\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /pillow { rewrite ^/pillow\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /tote-bag { rewrite ^/tote-bag\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /duvet-cover { rewrite ^/duvet-cover\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /shower-curtain { rewrite ^/shower-curtain\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /t-shirt { rewrite ^/t-shirt\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }


location /shutterstock-image {
rewrite ^/shutterstock-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?shutterstock=$2&shutterstock_type=$1&stock_api=1 last;
}

location /shutterstock-video {
rewrite ^/shutterstock-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?shutterstock=$2&shutterstock_type=$1&stock_api=1 last;
}

location /shutterstock-audio {
rewrite ^/shutterstock-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?shutterstock=$2&shutterstock_type=$1&stock_api=1 last;
}

location /fotolia-photo {
rewrite ^/fotolia-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?fotolia=$2&fotolia_type=$1&stock_api=1 last;
}

location /fotolia-video {
rewrite ^/fotolia-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?fotolia=$2&fotolia_type=$1&stock_api=1 last;
}

location /istockphoto-photo {
rewrite ^/istockphoto-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?istockphoto=$2&istockphoto_type=$1&stock_api=1 last;
}
location /istockphoto-videos {
rewrite ^/istockphoto-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?istockphoto=$2&istockphoto_type=$1&stock_api=1 last;
}
location /depositphotos-image {
rewrite ^/depositphotos-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?depositphotos=$2&depositphotos_type=$1&stock_api=1 last;
}

location /depositphotos-vector {
rewrite ^/depositphotos-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?depositphotos=$2&depositphotos_type=$1&stock_api=1 last;
}

location /depositphotos-videos {
rewrite ^/depositphotos-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?depositphotos=$2&depositphotos_type=$1&stock_api=1 last;
}

location /bigstockphoto-photo {
rewrite ^/bigstockphoto-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?bigstockphoto=$2&bigstockphoto_type=$1&stock_api=1 last;
}
location /123rf-photo {
rewrite ^/123rf-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?rf123=$2&rf123_type=$1&stock_api=1 last;
}
location /pixabay-photo {
rewrite ^/pixabay-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?pixabay=$2&pixabay_type=$1&stock_api=1 last;
}

location /pixabay-videos {
rewrite ^/pixabay-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?pixabay=$2&pixabay_type=$1&stock_api=1 last;
}   
   
location /shutterstock {
rewrite ^/shutterstock\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?shutterstock=$3&shutterstock_type=photo&stock_api=1&print_id=$2 last;
}
location /fotolia {
rewrite ^/fotolia\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?fotolia=$3&fotolia_type=photo&stock_api=1&print_id=$2 last;
}
location /istockphoto {
rewrite ^/istockphoto\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?istockphoto=$3&istockphoto_type=photo&stock_api=1&print_id=$2 last;
}
location /depositphotos {
rewrite ^/depositphotos\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?depositphotos=$3&depositphotos_type=photo&stock_api=1&print_id=$2 last;
}
location /bigstockphoto {
rewrite ^/bigstockphoto\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?bigstockphoto=$3&bigstockphoto_type=photo&stock_api=1&print_id=$2 last;
}
location /123rf {
rewrite ^/123rf\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?rf123=$3&rf123_type=photo&stock_api=1&print_id=$2 last;
}
location /pixabay {
rewrite ^/pixabay\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?pixabay=$3&pixabay_type=photo&stock_api=1&print_id=$2 last;
}
   
location /content {
rewrite "^/content\/([0-9]+)/thumb_original\.jpg$" /content/access_denied.gif last;
rewrite "^/content\/([0-9]+)/([^t]{1}[A-Za-z0-9_-]{0,})\.([^s]{1}[A-Za-z0-9]+)$" /members/download.php?u=$1/$2.$3 last;
}

location /content2 {
rewrite "^/content2\/([0-9]+)/thumb_original\.jpg$" /content/access_denied.gif last;
rewrite "^/content2\/([0-9]+)/([^t]{1}[A-Za-z0-9_-]{0,})\.([^s]{1}[A-Za-z0-9]+)$" /members/download.php?u=$1/$2.$3 last;
}   
   

location ^~ /content/              {}
location ^~ /content2/              {}
admin
Site Admin
 
Posts: 1458
Joined: Sun Mar 07, 2010 5:55 pm

Re: Nginx configuration required

Postby admin » Fri Oct 13, 2017 9:19 am

Updated nginx config for the 17.07 version:

Code: Select all
location /category {   
      rewrite ^/category\/([0-9a-z-]+).html$ /index.php?category=$1 last;
      rewrite ^/category\/([a-z]+)\/([0-9a-z-]+).html$ /index.php?category=$2&vd=$1 last;
   }

   location /stock-photo {
      rewrite ^/stock-photo\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=photo last;
   }

   location /stock-video {
      rewrite ^/stock-video\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=video last;
   }

   location /stock-audio {
      rewrite ^/stock-audio\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=audio last;
   }

   location /stock-vector {
      rewrite ^/stock-vector\/[0-9a-z-]+-([0-9]+).html$ /index.php?catalog=$1&ctypes=files last;
   }

   location /news {
      rewrite ^/news\/([0-9]+)\/*$ /news/?id=$1 last;
   }
   location /pages {
      rewrite ^/pages\/([0-9a-z-]+).html$ /members/page.php?id=$1 last;
   }
   

   location /users {
      rewrite ^/users\/([0-9a-z-]+)\/?$ /members/user.php?user_login=$1 last;
   }
   

   location /model {
      rewrite ^/model\/([0-9a-z-]+).html$ /members/model.php?model=$1 last;
   }
   
   location /blog {
      rewrite ^/blog\/([0-9a-z-]+)\/?$ /members/user_blog.php?user_login=$1 last;
      rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+)\/?$ /members/user_blog.php?user_login=$2&category=$1 last;
      rewrite ^/blog\/([0-9a-z-]+)\/([0-9a-z-]+)\/([0-9a-z-]+)\/?$ /members/user_blog.php?user_login=$3&ayear=$1&amonth=$2 last;
   }

   location /post {
      rewrite ^/post\/([0-9a-z-]+)\/([0-9a-z-]+)\/?$ /members/user_blog_post.php?user_login=$1&postid=$2 last;
   }

   location /testimonials {
      rewrite ^/testimonials\/([0-9a-z-]+)\/?$ /members/user_testimonials.php?user_login=$1 last;
   }
   location /friends {
      rewrite ^/friends\/([0-9a-z-]+)\/?$ /members/user_friends.php?user_login=$1 last;
   }

  location /static {
      rewrite ^/static([0-9]*)\/preview([0-9]*)\/[0-9a-z-]+-([0-9]+).(jpg|jpeg|flv|swf|wmv|mp4|mp3|mov)$ /content$1/$3/thumb$2.$4 last;
   }
   
   
   location /lightbox {
      rewrite ^/lightbox\/[0-9a-z-]+-([0-9]+).html$ /index.php?lightbox=$1 last;
   }
   
   location /collection {
      rewrite ^/collection\/[0-9a-z-]+-([0-9]+).html$ /index.php?collection=$1 last;
   }

location /canvas-print { rewrite ^/canvas-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /print { rewrite ^/print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /metal-print { rewrite ^/metal-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /framed-print { rewrite ^/framed-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /acrylic-print { rewrite ^/acrylic-print\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /greeting-card { rewrite ^/greeting-card\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /iphone-case { rewrite ^/iphone-case\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /galaxy-case { rewrite ^/galaxy-case\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /pillow { rewrite ^/pillow\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /tote-bag { rewrite ^/tote-bag\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /duvet-cover { rewrite ^/duvet-cover\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /shower-curtain { rewrite ^/shower-curtain\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }
location /t-shirt { rewrite ^/t-shirt\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?catalog=$2&ctypes=photo&print_id=$1 last; }


location /shutterstock-image {
rewrite ^/shutterstock-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?shutterstock=$2&shutterstock_type=$1&stock_api=1 last;
}

location /shutterstock-video {
rewrite ^/shutterstock-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?shutterstock=$2&shutterstock_type=$1&stock_api=1 last;
}

location /shutterstock-audio {
rewrite ^/shutterstock-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?shutterstock=$2&shutterstock_type=$1&stock_api=1 last;
}

location /fotolia-photo {
rewrite ^/fotolia-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?fotolia=$2&fotolia_type=$1&stock_api=1 last;
}

location /fotolia-video {
rewrite ^/fotolia-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?fotolia=$2&fotolia_type=$1&stock_api=1 last;
}

location /istockphoto-photo {
rewrite ^/istockphoto-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?istockphoto=$2&istockphoto_type=$1&stock_api=1 last;
}
location /istockphoto-videos {
rewrite ^/istockphoto-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?istockphoto=$2&istockphoto_type=$1&stock_api=1 last;
}
location /depositphotos-image {
rewrite ^/depositphotos-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?depositphotos=$2&depositphotos_type=$1&stock_api=1 last;
}

location /depositphotos-vector {
rewrite ^/depositphotos-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?depositphotos=$2&depositphotos_type=$1&stock_api=1 last;
}

location /depositphotos-videos {
rewrite ^/depositphotos-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?depositphotos=$2&depositphotos_type=$1&stock_api=1 last;
}

location /bigstockphoto-photo {
rewrite ^/bigstockphoto-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?bigstockphoto=$2&bigstockphoto_type=$1&stock_api=1 last;
}
location /123rf-photo {
rewrite ^/123rf-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?rf123=$2&rf123_type=$1&stock_api=1 last;
}
location /pixabay-photo {
rewrite ^/pixabay-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?pixabay=$2&pixabay_type=$1&stock_api=1 last;
}

location /pixabay-videos {
rewrite ^/pixabay-([a-z]*)\/[0-9a-z-]+-([0-9]+).html$ /index.php?pixabay=$2&pixabay_type=$1&stock_api=1 last;
}   
   
location /shutterstock {
rewrite ^/shutterstock\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?shutterstock=$3&shutterstock_type=photo&stock_api=1&print_id=$2 last;
}
location /fotolia {
rewrite ^/fotolia\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?fotolia=$3&fotolia_type=photo&stock_api=1&print_id=$2 last;
}
location /istockphoto {
rewrite ^/istockphoto\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?istockphoto=$3&istockphoto_type=photo&stock_api=1&print_id=$2 last;
}
location /depositphotos {
rewrite ^/depositphotos\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?depositphotos=$3&depositphotos_type=photo&stock_api=1&print_id=$2 last;
}
location /bigstockphoto {
rewrite ^/bigstockphoto\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?bigstockphoto=$3&bigstockphoto_type=photo&stock_api=1&print_id=$2 last;
}
location /123rf {
rewrite ^/123rf\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?rf123=$3&rf123_type=photo&stock_api=1&print_id=$2 last;
}
location /pixabay {
rewrite ^/pixabay\/(canvas-print|print|metal-print|framed-print|acrylic-print|greeting-card|iphone-case|galaxy-case|pillow|tote-bag|duvet-cover|shower-curtain|t-shirt)\/[0-9a-z-]+-([0-9]+)-([0-9]+).html$ /index.php?pixabay=$3&pixabay_type=photo&stock_api=1&print_id=$2 last;
}
   
location /content {
rewrite "^/content\/([0-9]+)/thumb_original\.jpg$" /content/access_denied.gif last;
rewrite "^/content\/([0-9]+)/([^t]{1}[A-Za-z0-9_-]{0,})\.([^s]{1}[A-Za-z0-9]+)$" /members/download.php?u=$1/$2.$3 last;
}

location /content2 {
rewrite "^/content2\/([0-9]+)/thumb_original\.jpg$" /content/access_denied.gif last;
rewrite "^/content2\/([0-9]+)/([^t]{1}[A-Za-z0-9_-]{0,})\.([^s]{1}[A-Za-z0-9]+)$" /members/download.php?u=$1/$2.$3 last;
}   
   

location ^~ /content/              {}
location ^~ /content2/              {}


admin
Site Admin
 
Posts: 1458
Joined: Sun Mar 07, 2010 5:55 pm


Return to Configuration

Who is online

Users browsing this forum: No registered users and 6 guests

cron
  Photo Store Script

Professional php photo stock script and WordPress plug-in for photographers and video producers.

  Support
  CMSaccount Inc.