一个专业运
维技术分享!

aria2 nginx配置

昨天发了一个aria2的安装教程,有伙伴咨询我说nginx怎么配置,今天特意写出昨天指导小伙伴nginx的详细配置供大家参考。

安装nginx,请移步《环境搭建篇》

创建aria2.conf文件,yum安装的nginx在/etc/nginx,而其他安装方式请自行按照安装的位置配置。

vi /etc/nginx/conf.d/aria2.conf

server {
server_name   aria.rednn.cn;    // 配置一个域名,如果是本地的配置,需要改成localhost;并添加一个端口
root        /opt/aria2;    // aria2的部署目录位置
location / {
root   /opt/aria2;
index  index.php index.html index.htm;
try_files $uri $uri/ /index.php$is_args$args;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page   500 502 503 504  /50x.html;
location = /50x.html {
root   html;
}
include /etc/nginx/default.d/*.conf; // 这里引用的是php环境变量
location ~ /\.ht {
deny  all;
}
}

重启nginx

systemctl restart nginx

访问http://127.0.0.1或者访问http://ip:端口。

至此配置完成,如果还有哪里不明白的可以留言!



微信扫描下方的二维码阅读本文

赞(5) 打赏
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。小柳实验室 » aria2 nginx配置

相关推荐

  • 暂无文章

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏