问题描述
我已经在整个stackoverflow上进行了搜索,但找不到与此匹配的东西,希望这很简单。我想要的是下面列出的;
http://mylink.com应该从/ var / www / http://mylink.com/l/random应该从/ test / random中加载(单词“ random”是一个随机字符串)
server {
root /var/www;
index index.PHP index.html;
server_name mylink.com www.mylink.com;
location / {
try_files $uri $uri/ =404;
}
# Listing page (multiple files)
location /l/ {
root /test;
}
////extra lines with PHP etc below
}
我也尝试过使用location ^~ /l/(.*)
,然后使用别名或root与$1
路径一起使用,但是找不到正确的组合来使其正常工作,通常返回404。
基本上不使用“ l”,它应该加载默认的/var/www/
并使用“ l”,我希望它从“ / test / ”(是“ l”之后的内容,例如mylink.com/l/customlink
-> /test/customlink/index.PHP
任何帮助将不胜感激,希望这是我犯错的一件简单事情,我希望这是有道理的!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)