nginx rewrite


location ~ "(product)\.php" {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/t_php/test_re/search$fastcgi_script_name;
include fastcgi_params;
}

location / {

rewrite "^/(.*)\/(\d{2})\.html" /product.php?action=product_detail&type=$1&product_id=$2 last;

}


访问 http://tool.yebanhei.com:8090/hh/10.html

打印$_GET 如下:

array(2) {
  ["type"]=>
  string(2) "hh"
  ["product_id"]=>
  string(2) "10"
}

 

 

php-fpm Nginx 502 Bad Gateway – Permission denied

http://stackoverflow.com/questions/24325695/nginx-and-php-fpm-socket-owner

http://stackoverflow.com/questions/23598271/nginx-502-bad-gateway-permission-denied

php-fpm.conf 中
172 ; Set permissions for unix socket, if one is used. In Linux, read/write
173 ; permissions must be set in order to allow connections from a web server. Many
174 ; BSD-derived systems allow connections regardless of permissions.
175 ; Default Values: user and group are set as the running user
176 ; mode is set to 0660
177 listen.owner = nobody
178 listen.group = nobody
179 listen.mode = 0660

nginx.conf 中
user nobody nobody;