分类 Linux 下的文章


nginx rewrite 模块主要应用于修改客户端发起的 url 请求,主要使用场景有两个:
1.客户端请求的域名已经已经有了新的地址,需要自动将连接进行转换
2.需要根据请求的 url 动态处理到不同的页面,此处主要使用 try_files 指令

阅读全文


本文主要参考的网站:
https://cipherli.st
https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html

This tutorial shows you how to set up strong SSL security on the nginx webserver. We do this by updating OpenSSL to the latest version to mitigate attacks like Heartbleed, disabling SSL Compression and EXPORT ciphers to mitigate attacks like FREAK, CRIME and LogJAM, disabling SSLv3 and below because of vulnerabilities in the protocol and we will set up a strong ciphersuite that enables Forward Secrecy when possible. We also enable HSTS and HPKP. This way we have a strong and future proof ssl configuration and we get an A+ on the Qually Labs SSL Test.

阅读全文


这里使用的是 Nginx 做代理。

使用 http2 需要 openssl 的版本至少是 1.0.2。使用命令openssl version查看当前版本,如果太低,需要先升级 openssl。

升级教程:https://niekun.net/index.php/archives/30.html

在 Nginx 配置文件的 server 段内修改如下:

server {
    listen               443 ssl http2;
    listen               [::]:443 ssl http2;
    ...
}

实际就是在原有配置基础上,在 listen 内加入 http2 即可。

修改后测试及重新加载配置文件:

service nginx configtest
service nginx reload