Skip to content

Instantly share code, notes, and snippets.

@jimishjoban
Created April 28, 2011 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimishjoban/946479 to your computer and use it in GitHub Desktop.
Save jimishjoban/946479 to your computer and use it in GitHub Desktop.
Nginx coupons config
location /coupons/ {
alias /home/jjobanputra/code/coupon/upload/;
index index.php index.html index.htm;
if (-e $request_filename) {
expires 30d;
break;
}
rewrite /coupons/(.+)$ /coupons/index.php?q=$1;
}
location = /coupons {
try_files $uri $uri/ @coupons;
}
location @coupons {
include fastcgi_params;
fastcgi_pass 127.0.0.1:53217;
fastcgi_split_path_info ^(/coupons)(/.*)$;
fastcgi_param SCRIPT_FILENAME /home/jjobanputra/code/coupon/upload/index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /coupons/?.*\.php$ {
if ($fastcgi_script_name ~ /coupons/?(.*)$) {
set $valid_fastcgi_script_name /$1;
}
fastcgi_pass 127.0.0.1:53217;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/jjobanputra/code/coupon/upload/$valid_fastcgi_script_name;
include /opt/nginx/conf/fastcgi.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment