我有一堆使用.php?id = 123的PHP文件,我需要將它們全部取出。我如何在我的配置文件中完成它們?nginx GET .php變量
我似乎無法弄清楚如何利用
get1.php?id=stuff
get2.php?id=stuff
get3.php?id=stuff
等等...
的問題是我怎麼做,當他們都在相同的根目錄?
用下面我上p.php 500錯誤ID = 945,但PHP工作正常,但我不能登錄或獲取POST數據到工作
server {
listen 80;
server_name site.com www.site.com;
root /home/site/public_html;
location/{
index index.php index.html index.htm;
location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
expires 1d;
try_files $uri?$args @backend;
}
error_page 405 = @backend;
add_header X-Cache "HIT from Backend";
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location @backend {
internal;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*\.(php|jsp|cgi|pl|py)?$ {
try_files $uri?$args /index.php;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
這樣:只是500S 重寫或內部重定向循環而內部重定向到「的index.php」
server {
listen 80;
server_name site.com www.site.com;
root /home/site/public_html;
#try and serve static files directly
location ~* ^[^\?\&]+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
try_files $uri @inPlaceDynamicFile;
expires 24h;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
#allow us to have dynamic css/js files
location @inPlaceDynamicFile {
# examples /css/cssIncludes.css => /css/cssIncludes.css.php
try_files $uri.php =404;
fastcgi_pass 127.0.0.1:9001;
include fastcgi_params.conf;
}
location/{
try_files $uri?$args /index.php?q=$uri&$args;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params.conf;
}
}
btw//.ht應該是「location〜/ \」。{access_log off; log_not_found off;否認一切; }「來阻止所有'隱藏'文件 – Danack 2013-04-24 19:53:17