-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.json
1 lines (1 loc) · 4.89 KB
/
content.json
1
{"posts":[{"title":"Debian 使用Nginx + SmartDNS 建DoH","text":"删除默认源的Nginx(如果安装了Nginx)1sudo apt remove nginx-* 配置Nginx官方源Nginx Debian Packages Install 安装Nginx的njs模块1sudo apt install nginx-module-njs 打开/etc/nginx/nginx.conf,在顶层添加以下配置加载模块 12load_module modules/ngx_http_js_module.so;load_module modules/ngx_stream_js_module.so; 下载SmartDNS的deb安装SmartDNS 1sudo apt install smartdns.* 配置tcp端口修改/etc/smartdns/smartdns.conf添加以下配置 12bind 127.0.0.1:53bind-tcp 127.0.0.1:53 其余关于SmartDNS的配置参考SmartDNS Doc 配置Nginx参考Using NGINX as a DoT or DoH Gateway下载nginx-dns,拷贝njs.d目录到/etc/nginx/目录下编辑/etc/nginx/nginx.conf,在文件末尾追加以下配置 123456789101112131415161718stream { js_import /etc/nginx/njs.d/dns/dns.js; # DNS upstream pool upstream dns { zone dns 64k; server 127.0.0.1:53; } # DNS over HTTPS (gateway) service # This time we’ve used a DoT upstream server { listen 127.0.0.1:8053; js_filter dns.filter_doh_request; proxy_ssl on; proxy_pass dot; }} 新增Nginx文件配置文件/etc/nginx/sites-available/doh.conf 1sudo nano /etc/nginx/sites-available/doh.conf 添加以下配置: 12345678910111213141516171819202122232425# This is our upstream connection to the njs translation processupstream dohloop { zone dohloop 64k; server 127.0.0.1:8053;}# This virtual server accepts HTTP/2 over HTTPSserver { listen 443 ssl http2; ssl_certificate /etc/nginx/ssl/certs/doh.local.pem; ssl_certificate_key /etc/nginx/ssl/private/doh.local.pem; # Return 404 for non-DoH requests location / { return 404 "404 Not Found\\n"; } # Here we downgrade the HTTP/2 request to HTTP/1.1 and forward it to # the DoH loop service location /dns-query { proxy_http_version 1.1; proxy_set_header Connection ""; proxy_pass http://dohloop; }} 修改证书地址为自己域名的证书。 启动服务123456sudo ln -s /etc/nginx/sites-available/doh.conf /etc/nginx/sites-enabled/doh.confsudo systemctl enable smartdnssudo systemctl enable nginxsudo systemctl start smartdnssudo systemctl start nginx","link":"/2022/03/01/Debian-%E4%BD%BF%E7%94%A8Nginx-SmartDNS-%E5%BB%BADoH/"},{"title":"Debian编译安装Nginx","text":"准备1.下载PCRE库,并解压2.下载zlib库,并解压3.下载Nginx的最新代码,解压 4.安装openssl和openssl-dev 12apt install opensslapt install libssl-dev 5.创建目录 123mkdir /etc/nginx/mkdir /var/log/nginx/mkdir /var/tmp/nginx/ 编译安装过程写好各种参数,到Nginx的源码目录下运行配置命令。其中,还要使用参数指向刚才下载的PCRE和zlib库的位置。 12345678910111213141516171819202122232425./configure \\ --prefix=/usr/local/nginx \\ --conf-path=/etc/nginx/nginx.conf \\ --sbin-path=/usr/sbin/ \\ --pid-path=/var/run/nginx.pid \\ --lock-path=/var/lock/nginx.lock \\ --user=www-data \\ --group=www-data \\ --with-http_ssl_module \\ --with-http_dav_module \\ --with-http_flv_module \\ --with-http_realip_module \\ --with-http_gzip_static_module \\ --with-http_stub_status_module \\ --with-mail --with-mail_ssl_module \\ --with-pcre=../pcre-8.45 \\ --with-zlib=../zlib-1.2.11 \\ --with-debug \\ --http-log-path=/var/log/nginx/access.log \\ --error-log-path=/var/log/nginx/error.log \\ --http-client-body-temp-path=/var/tmp/nginx/client \\ --http-proxy-temp-path=/var/tmp/nginx/proxy \\ --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \\ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \\ --http-scgi-temp-path=/var/tmp/nginx/scgi 编译并安装 1make && make install","link":"/2022/02/24/Debian%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85Nginx/"},{"title":"Linux通过inode值删除特殊字符文件","text":"使用ls -i查询文件inode值使用find命令删除 1find ./ -inum inode -delete 或者 1find ./ -inum inode | xargs rm -rf","link":"/2022/02/24/Linux%E9%80%9A%E8%BF%87inode%E5%80%BC%E5%88%A0%E9%99%A4%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E6%96%87%E4%BB%B6/"},{"title":"Hexo - Hello World","text":"Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment","link":"/2022/02/24/hello-world/"}],"tags":[{"name":"技术","slug":"技术","link":"/tags/%E6%8A%80%E6%9C%AF/"},{"name":"Linux","slug":"Linux","link":"/tags/Linux/"},{"name":"Nginx","slug":"Nginx","link":"/tags/Nginx/"},{"name":"其他","slug":"其他","link":"/tags/%E5%85%B6%E4%BB%96/"}],"categories":[{"name":"技术","slug":"技术","link":"/categories/%E6%8A%80%E6%9C%AF/"},{"name":"其他","slug":"其他","link":"/categories/%E5%85%B6%E4%BB%96/"}],"pages":[{"title":"","text":"Blog","link":"/about.html"}]}