Augustus 大佬有话说 :
【已解决】问一个nginx的问题
本帖最后由 Augustus 于 2020-4-28 07:34 编辑
之前网上有教程,但现在那个博客没了,来论坛问问。
要实现的目标是这样的,一个种子盒子,访问http://网址/soft会展示bt软件的下载目录
有一个配置方法,访问http://example.com/soft 在nginx里设置访问 /soft的时候访问一个不在/www下的目录,类似创建快捷方式的那种,配置大致是这样;
location /soft {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
访问 网址/soft 的时候会访问一个目录
red233 大佬有话说 :
没懂,根目录吗?php有函数
ansheng 大佬有话说 :
你这不是已经做好了吗
Augustus 大佬有话说 :
ansheng 大佬有话说 : 2020-4-28 07:16
你这不是已经做好了吗
nginx里写入
location /soft {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
打开http://网址/soft 出来的是404
Augustus 大佬有话说 :
ansheng 大佬有话说 : 2020-4-28 07:16
你这不是已经做好了吗
要实现的目标是这样的,一个种子盒子,访问http://网址/soft会展示bt软件的下载目录
ansheng 大佬有话说 :
Augustus 大佬有话说 : 2020-4-28 21:19
nginx里写入
location /soft {
你指定的root目录下有soft这个目录嘛?
blackdog 大佬有话说 :
楼主的意思是/www是根目录,然后soft目录不在/www目录下是吗
Augustus 大佬有话说 :
ansheng 大佬有话说 : 2020-4-28 07:22
你指定的root目录下有soft这个目录嘛?
原来我要用的是虚拟目录,这样配置就成功了
location /down {
alias /var/lib/transmission/Downloads;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
blackdog 大佬有话说 :
Augustus 大佬有话说 : 2020-4-28 21:33
原来我要用的是虚拟目录,这样配置就成功了
location /down {
alias指定的目录后面要加 / 的吧
Augustus 大佬有话说 :
blackdog 大佬有话说 : 2020-4-28 07:38
alias指定的目录后面要加 / 的吧
似乎不用,没加也成功了