nginx飞牛原生fpk
前置说明:
飞牛os内置nginx,但是官方并未开放使用,许多用户需要完整的nginx使用体验,并且Lucky的web服务并不能满足这些用户。之前也有用户在我评论区许愿nginx,当时我拒绝了(麻烦而且我不会)。这两天把docker版cloudsaver爆改成原生版的时候,不可避免的需要用到nginx,于是顺带研究了一下。
研究经过:
这个项目说难也不难,麻烦是挺麻烦的。初版方案采用cloudsaver内置nginx的同方案,从官方deb安装包提取arm、x86的二进制文件,结合软链接和启动参数将各个工作目录定向至目标路径,但是这样一来cache目录就会和cloudsaver内置nginx的cache目录冲突,无奈推到重做。
第二版采用源码编译构建的方案,在编译配置的时候就将各个目录路径写入硬编码,由于采用docker-debian12编译,当前版本不支持arm64。文末分享构建时的配置,arm用户有需要的可参照配置自行构建,替换@appcenter中的Nginx,即可运行。
使用说明:
进入应用文件/Nginx子目录。编辑/etc/nginx.conf添加web服务;/nginx放置静态html资源或cgi动态资源;/lib/modules额外添加nginx模组。重启加载配置。
本项目已为飞牛目录结构和应用架构特化,编辑nginx.conf时注意路径和用户名。更多使用说明可参考官方文档。
安全声明:
本项目root运行。用户可自行拆包检查、修改相关代码。本人既不能也不会在项目中留下后门漏洞,也请诸位自觉维护社区生态。
更新日志:
1.28.2-1:初始版本。
下载地址:
百度网盘:https://pan.baidu.com/s/10MSoAqqhxB8q-9nSlQm0jQ?pwd=nrec
夸克网盘:https://pan.quark.cn/s/faef9924fcfb,提取码:1YWh
FnDepot源:https://github.com/shuangji66/FnDepot
楼主写的其他小玩意:https://club.fnnas.com/forum.php?mod=viewthread&tid=51729,并已上架FnDepot第三方商店,欢迎体验。

编译的配置:
./configure \
--prefix=/var/apps/Nginx/var \
--sbin-path=/var/apps/Nginx/target/Nginx \
--modules-path=/var/apps/Nginx/shares/lib/modules \
--conf-path=/var/apps/Nginx/shares/etc/nginx.conf \
--pid-path=/var/apps/Nginx/var/nginx.pid \
--lock-path=/var/apps/Nginx/var/nginx.lock \
--http-client-body-temp-path=/var/apps/Nginx/var/cache/client_temp \
--http-proxy-temp-path=/var/apps/Nginx/var/cache/proxy_temp \
--http-fastcgi-temp-path=/var/apps/Nginx/var/cache/fastcgi_temp \
--http-uwsgi-temp-path=/var/apps/Nginx/var/cache/uwsgi_temp \
--http-scgi-temp-path=/var/apps/Nginx/var/cache/scgi_temp \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_v3_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_image_filter_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_auth_request_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_slice_module \
--with-http_stub_status_module \
--with-select_module \
--with-poll_module \
--with-threads \
--with-file-aio \
--with-pcre \
--with-pcre-jit \
--with-stream \
--with-stream_ssl_module \
--with-mail \
--with-mail_ssl_module