<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>系统运维 &#187; pathinfo</title>
	<atom:link href="http://www.osyunwei.com/archives/tag/pathinfo/feed" rel="self" type="application/rss+xml" />
	<link>https://www.osyunwei.com</link>
	<description>国产化OS/AnolisOS/openEuler/RHEL/CentOS/Rocky Linux/Debian/Ubuntu Linux FreeBSD 服务器教程 &#124; Windows Server 2003/2008/2012/2016/2019/2022/2025服务器教程</description>
	<lastBuildDate>Sun, 10 May 2026 14:53:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nginx下配置支持ThinkPHP的pathinfo模式</title>
		<link>https://www.osyunwei.com/archives/9804.html</link>
		<comments>https://www.osyunwei.com/archives/9804.html#comments</comments>
		<pubDate>Mon, 28 Nov 2016 01:18:40 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[pathinfo]]></category>
		<category><![CDATA[ThinkPHP]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=9804</guid>
		<description><![CDATA[说明： Nginx目录：/usr/local/nginx/ Nginx配置文件：/usr/local/nginx/nginx.conf 如果站点使用了vhost虚拟主机，并且只需要这一个虚拟主机支持pathinfo的，可以直接打开你的vhost的配置文件进行设置（绿色字为修改代码，蓝色字为增加代码）。 找到类似如下代码： location ~ .*\.(php&#124;php5)?$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #原来的代码 ...... } 编辑配置文件为以下代码： location ~ \.php { #定义变量 $path_info ，用于存放pathinfo信息 set $path_info ""; #定义变量 $real_script_name，用于存放真实地址 set $real_script_name $fastcgi_script_name; #如果地址与引号内的正则表达式匹配 if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { #将文件地址赋值给变量 $real_script_name set $real_script_name $1; #将文件地址后的参数赋值给变量 $path_info set $path_info $2; } #配置fastcgi的一些参数 fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/9804.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/9804.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
