日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > php >内容正文

php

nginx php跳转url参数,NGINX 中把url中的内容当初参数处理

發(fā)布時(shí)間:2025/4/5 php 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx php跳转url参数,NGINX 中把url中的内容当初参数处理 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

作用:把url為:127.0.0.1/index.php/a/b/c?這樣處理

把?post參數(shù):?/a/b/c到127.0.0.1/index.php

nginx?配置如下:

server?{

listen??80;

server_name?????127.0.0.1;

root?/home/shaddock/Applications/htdocs;

index?index.html?index.htm?index.php?index.js;

access_log?logs/access.log;

error_log?logs/error.log;

error_page?404??/404.html;

location?/404.html?{

root?/home/shaddock/Applications/htdocs;

}

location?/dmp5.0{

index?index.html?index.htm?index.php;

if?(-e?$request_filename)?{

break;

}

if?(!-e?$request_filename)?{

rewrite?^/dmp5.0/(.*)$?/dmp5.0/index.php/$1?last;

break;

}

}

location?~?.+\.php($|/)?{

root/home/shaddock/Applications/htdocs;

fastcgi_index?index.php;

fastcgi_split_path_info?^(.+\.php)(.*)$;

fastcgi_param???SCRIPT_FILENAME?$document_root$fastcgi_script_name;

fastcgi_param???PATH_INFO???????????????$fastcgi_path_info;

fastcgi_param???PATH_TRANSLATED?$document_root$fastcgi_path_info;

fastcgi_pass???127.0.0.1:9000;

include????????fastcgi_params;

}

}

錯(cuò)誤:

2017/01/09?10:48:58?[error]?5103#0:?*57?open()?"/home/shaddock/Applications/htdocs/dmp5.0/index.php/index/index/ajaxLogin"?failed?(20:?Not?a?directory),?client:?127.0.0.1,?server:?127.0.0.1,?request:?"POST?/dmp5.0/index/index/ajaxLogin?HTTP/1.1",?host:?"127.0.0.1",?referrer:?"http://127.0.0.1/dmp5.0/"

上面的錯(cuò)誤是因?yàn)閞ewrite的時(shí)候直接把url?http://127.0.0.1/dmp5.0/index.php/index/index/ajaxLogin當(dāng)成頁(yè)面處理了。本意應(yīng)該是

http://127.0.0.1/dmp5.0/index.php/index/index/ajaxLogin這個(gè)url把這些單詞參數(shù),傳給http://127.0.0.1/dmp5.0/index.php

解決:

php中php.ini中下面參數(shù)打開(kāi)

cgi.fix_pathinfo=1

總結(jié)

以上是生活随笔為你收集整理的nginx php跳转url参数,NGINX 中把url中的内容当初参数处理的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。