nginx
nginx
nginx 做域名绑定
nginx server_name nginx学习(十)——nginx的配置系统6之server_name - CSDN博客 Nginx中的默认主机及location设置(摘自淘宝) - CSDN博客
nginx 配置ssl https请求
Nginx启动SSL功能,并进行功能优化,你看这个就足够了 FreeSSL - 一个申请免费HTTPS证书的网站 Nginx+Https配置 - 倚楼听风雨 - SegmentFault 思否 官方-配置HTTPS服务器
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name *.rizon.top;
ssl on;
root html;
index index.html index.htm;
ssl_certificate /etc/nginx/cert/certificate.pem;
ssl_certificate_key /etc/nginx/cert/certificate.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /home/website;
index index.html index.htm;
}
}nginx 配置301跳转
```conf /etc/nginx/nginx.conf server_name example.com; return 301 https://$host$request_uri;
使用nginx stream
tag 代理mysql stream代理ssh tcp反向代理 nginx代理ssh
Module ngx_stream_core_module caojx-git/learn nginx使用stream模块做ssh转发
/etc/nginx/nginx.conf
```conf /etc/nginx/nginx.conf
要注意不要放到http块中,因为这个不是http转发而是tcp层的转发
stream模块使用yum安装的高版本nginx是有的,编译安装的默认可能没有
stream {
}
语法说明 rewrite regex replacement [flag]; 关键字 正则 替代内容 flag标记
正则:perl兼容正则表达式语句进行规则匹配 替代内容:将正则匹配的内容替换成replacement flag标记:rewrite支持的flag标记
flag标记说明: last #本条规则匹配完成后,继续向下匹配新的location URI规则 break #本条规则匹配完成即终止,不再匹配后面的任何规则 redirect #返回302临时重定向,浏览器地址会显示跳转后的URL地址 permanent #返回301永久重定向,浏览器地址栏会显示跳转后的URL地址
Last updated
Was this helpful?