组建一个简易的自用CDN

CDN是什么 A content delivery network or content distribution network (CDN) is a geographically distributed network of proxy servers and their data centers. The goal is to distribute service spatially relative to end-users to provide high availability and high performance. CDNs serve a large portion of the Internet content today, including web objects (text, graphics and scripts), downloadable objects (media files, software, documents), applications (e-commerce, portals), live streaming media, on-demand streaming media, and social media sites. CDN 维基百科 我对CDN的简单需求 现在博客是放在美西的服务器,访问延迟还能接受. 不过 »

在Nginx中配置Google-Analytics

原因 在Nginx端配置Google-Analytics和在HTML中加载Google-Analytics有几个显著的有点, 杜绝用户到Google Analytics之间的网络问题,特别是国内(尽管已经解析到Google在北京的服务器) 防止ad »

Author image 月杪 on #Nginx,

Nginx 1.13.9 HTTP/2 server push 介绍

2018年2月20日发布的NGINX 1.13.9开始支持HTTP/2服务器推送功能. HTTP/2规范中定义的服务器推送允许服务器抢先将资源推送到远程客户端,预计客户端可能很快会请求这些资源.通过这样做,您可以在页面加载操作中将RTT(往返时 »

Author image 月杪 on #Nginx,

使用LetsEncrypt签发多域名ECC证书

克隆certbot cd /opt git clone https://github.com/certbot/certbot.git 配置openssl.cnf cp /etc/ssl/openssl.cnf /opt/certbot/ vi openssl.cnf # 在[ v3_req ]标签下添加 subjectAltName = @alt_names [ alt_names ] DNS.1 = example.com DNS.2 = www.example.com DNS.3 = sub.example.com ... 生成CSR文件 openssl ecparam -genkey -name secp384r1 > ec.key openssl req -new -sha384 -key ec.key -out ec-der.csr -outform der -config openssl.cnf 通过LetsEncrypt签发证书 ./certbot-auto certonly -a webroot --webroot-path=/var/www/html -d example.com -d www.example.com ... --csr ec-der.csr 通过此方法生成 »

为Nginx添加TLS1.3支持

Nginx主线分支从1.13.0版本开始支持TLS1.3,只需要在编译的时候选择使用OpenSSL支持TLS1.3的分支进行编译即可. 使用对应的OpenSSL分支进行编译 # OpenSSL对TLS1.3的支持已经到了draft19,不过Chr »

手动编译Nginx支持ALPN,以在最新版Chrome中支持HTTP/2

安装一些必要的工具 apt-get install build-essential libpcre3 libpcre3-dev zlib1g-dev 下载需要的源代码 # Openssl版本需要1.0.2才能支持ALPN,而后者是新版Chrome支持HTTP/2的必要条件 wget -O openssl.zip -c https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz unzip openssl.zip mv openssl-OpenSSL_1_1_1c/ openssl wget -O nginx-ct.zip -c https://github.com/grahamedgecombe/nginx-ct/archive/v1.3.2.zip unzip nginx-ct.zip # 获取Nginx源码 wget -c https://nginx.org/download/nginx-1.19.6.tar.gz tar zxf nginx-1.19.6.tar.gz # 编译 cd nginx-1.19.6/ # 编译参数参考了 »

Author image 月杪 on #Nginx,

Setup LetsEncrypt on Debian

Install LetsEncrypt Client git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt Obtain a Certificate Inside the nginx config, add this location block: location ~ /\.well-known/acme-challenge { root /var/www/html; } Reload Nginx: systemctl reload nginx Generate Certificate: cd /opt/letsencrypt ./letsencrypt-auto certonly -a webroot \ --webroot-path=/var/www/html \ -d example.com \ -d www.example.com »