2
我對nginx來說有些新鮮,並且在重寫時遇到困難。我想獲得:URL參數和重寫
/C/545_453453_4534
訪問c.php傳遞545_453453_4534作爲PARAMS
這裏是我當前的conf:
location/{
try_files $uri $uri/ @extensionless-php;
index index.html index.htm index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:8000;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
謝謝!