Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

ThinkPHP多应用如何访问静态资源?

单应用模式下,访问静态文件地址可以直接访问:
网址/static/images/logo.png
而多应用的模式下,访问 网址/static/images/logo.png,
则会被编译成控制器,应该怎样设置才能直接访问静态资源?
我使用的是nginx服务器 如果需要地址重写,麻烦详细告知下,在此谢过!!!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

可以单独给static目录建一个nginx的vhost,指定一个独立的域名,比如static.test.com

所有应用内配置这个静态文件访问域名,就可以共享访问了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...