Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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