Press "Enter" to skip to content

Nginx/PHP Fastcgi PATH_INFO的一个问题

通过在nginx.conf中模拟PATH_INFO的方法会有一个bug. 那就是PATH_INFO不会被urldecode.
对于Apache+PHP(php2handler)来说, PATH_INFO来自Apache, 不会有问题, 对于Apache fastcgi也应该没有问题, 因为PATH_INFO也是由Apache生成.
但是对于nginx+fastcgi, 因为对于cgi来说PATH_INFO来自于ENV(fastcgi_params), 而php-cgi中的import_environment_variables不会对ENV中的变量做urldecode.
这样, nginx看到的url是urlencode以后的, 从url中分离出来的PATH_INFO也是urlencode后的, forward给php proxy以后, PHP看到的PATH_INFO也是urlencode的了.
所以, 如果在PATH_INFO中包含一些宽字符, 或者是"+", 那就要注意了, 需要我们主动的urldecode一下再使用.

14 Comments

  1. HP Customer Service
    HP Customer Service February 22, 2019

    Contact HP Technical Support (+1)-855-499-1999 Customer Care Number and sort out the all HP Technical issues with HP Technical Support experts technicians who are well trained and experienced in this field and working 24×7 hours for You so if you have any kind of HP Technical issues so contact us and ring the bell on this numbers (+1)-855-499-1999 for HP Customer Support.
    http://hpcustomer-service.com/

  2. shell shockers
    shell shockers February 3, 2019

    Thanks for nice and informative article.

  3. clake jhone
    clake jhone February 2, 2019

    Excellent post, People who are looking HP support number please call us now 1-877-719-5266.

  4. mariya
    mariya January 16, 2019

    Please share this information also in English.

  5. Candice
    Candice June 12, 2015

    I think the admin of this website is actually working hard in support of his site,
    because here every information is quality based material.
    web site (Candice)

  6. Terrie
    Terrie January 17, 2015

    With havin so much content do you ever run into any issues of plagorism or copyright
    infringement? My website has a lot of unique content I’ve either authored myself or outsourced but it seems a
    lot of it is popping it up all over the internet without my agreement.
    Do you know any solutions to help protect against content from
    being stolen? I’d really appreciate it.
    web site – Terrie

  7. 金属管
    金属管 January 13, 2011

    几种常用金属管转子流量计的基础知识和比较,叶轮、涡轮流量计、活塞或孔板等用以分流流体。PD流量计的精确度较高,是测量粘性液体的几种方法之一。齿轮流量计像PD流量计,涡轮流量计也会产生不可恢复的压力误差,也需要移动部件。 电磁流量计 具有传导性的流体在流经电磁场时,通过测量电压可得到流体的速度;齐齐哈尔市旅游资源十分丰富,波士顿旅游素以生态环境良好,野生动物植物繁多,山水景色秀美,文化古迹奇特,冰雪风光绮丽而著称。纽约购物近年来,我市旅游产业有了长足的发展,cheap handbags已经成为国民经济的重要组成部分。特别是我市是少数民族聚集区域NFL Jerseys,民族地区的历史文化积淀深厚,自然资源超声波清洗机、人文资源独具特色

  8. 金属管转子流量
    金属管转子流量 November 15, 2010

    几种常用金属管转子流量计的基础知识和比较,叶轮、涡轮流量计、活塞或孔板等用以分流流体。PD流量计的精确度较高,是测量粘性液体的几种方法之一。齿轮流量计像PD流量计,涡轮流量计也会产生不可恢复的压力误差,也需要移动部件。 电磁流量计 具有传导性的流体在流经电磁场时,通过测量电压可得到流体的速度;齐齐哈尔市旅游资源十分丰富,波士顿旅游素以生态环境良好,野生动物植物繁多,山水景色秀美,文化古迹奇特,冰雪风光绮丽而著称。纽约购物近年来,我市旅游产业有了长足的发展,cheap handbags已经成为国民经济的重要组成部分。特别是我市是少数民族聚集区域NFL Jerseys,民族地区的历史文化积淀深厚,自然资源超声波清洗机、人文资源独具特色。

  9. verdana
    verdana March 1, 2010

    尝试一下 fastcgi_split_path_info

Comments are closed.