caddy搭建静态+PHP+伪静态Web服务器

feieryun-v2.hk2.anan.cc {
	handle_path /AdminLTE/* {
		root C:\data\service\caddy\www\AdminLTE
		file_server
		encode
	}
	handle_path /static/* {
		root C:\data\service\caddy\www\v2.feieryun.cn\wwwroot\static
		file_server
		encode
	}
	handle_path /* {
		@phpFiles {
			path */
			path *.php
		}
		root @phpFiles C:\data\service\caddy\www\v2.feieryun.cn\sitebase\firadio
		php_fastcgi @phpFiles 127.0.0.1:9000 {
			try_files {path} {path}/index.php =404
		}
	}
	handle_path /* {
		root C:\data\service\caddy\www\v2.feieryun.cn\sitebase\firadio
		php_fastcgi 127.0.0.1:9000
		@notExist not file
		rewrite @notExist /index.php/{path}
	}
	handle_path /* {
		root C:\data\service\caddy\www\v2.feieryun.cn\sitebase\firadio
		file_server
		encode
	}
}

posted on 2025-10-07 01:53  项希盛  阅读(0)  评论(0)    收藏  举报