肥兔 发布的文章

Checkout the latest ngx_brotli and build the dependencies:

git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli
cd ngx_brotli/deps/brotli
mkdir out && cd out
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
cmake --build . --config Release --target brotlienc

nginx编译时增加
--add-module=/path/to/ngx_brotli

- 阅读剩余部分 -

在http部分配置了

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;

在vhost中配置了

add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";

在nginx documentation 的 Module ngx_http_headers_module 中提到了一段话,大致意思就是,如果当前级别没有定义 add_header 则会继承上一级,如果定义了 add_header 则不会去理会上一级。

There could be several add_header directives. These directives are
inherited from the previous configuration level if and only if there
are no add_header directives defined on the current level.

意味着vhost如果定义了add_header,则不会从主配置中继承,由于子站点配置了HSTS,定义了add_header,所以主配置中的add_header不再生效。

- 阅读剩余部分 -

安装libunwind-dev

apt install libunwind-dev

拉取源代码

git clone https://github.com/gperftools/gperftools.git
./autogen.sh
./configure --enable-frame-pointers --enable-libunwind
make && make install
ldconfig
ln -sf /usr/local/lib/libtcmalloc* /usr/lib/

- 阅读剩余部分 -

软件版本:V5R021C00S050,10G-EPON

备份jffs2,电脑IP设置为192.168.100.2 (已执行restorehwmode.sh)
telnet 192.168.100.1
root
adminHW
su
shell
cd /dev/shm
tar -cvf jffs2.tar /mnt/jffs2
tftp -pl jffs2.tar 192.168.100.2

执行restorehwmode.sh恢复公版界面后,电脑IP设置为192.168.100.2

通过HW Dollar2修改hw_boardinfo文件对应值
obj.id = "0x00000001" ; obj.value = "5";
obj.id = "0x0000001d" ; obj.value = "5";
obj.id = "0x00000059" ; obj.value = "5";

cd /mnt/jffs2
tftp -g -l hw_boardinfo -r hw_boardinfo 192.168.100.2
tftp -g -l hw_boardinfo.bak -r hw_boardinfo 192.168.100.2
exit
reset

编译参数增加 --with-http_v3_module

在nginx.conf启用reuseport

listen 80 default_server reuseport;
listen 443 ssl default_server reuseport;

在vhost中增加

listen 443 quic;
add_header Alt-Svc 'h3=":443"; ma=86400';

目前在用版本信息
nginx version: freenginx/1.27.4
built by gcc 12.2.0 (Debian 12.2.0-14)
built with OpenSSL 3.0.15 3 Sep 2024

防火墙放通UDP 443
HTTP3检测 https://http3check.net/
个人使用方案,仅作记录。