随笔分类 -  nginx

摘要:之前服务器单体架构mysql是直接安装在服务器的,没有买托管,这就造成一个问题,如果想要远程连接mysql就要开启3306防火墙端口,全是恶意ip进行攻击。。。。 nginx的stream模块可以有效限制远程ip访问 stream { server { listen 13306; # 需要开启云服务 阅读全文
posted @ 2024-06-13 09:14 朝阳1 阅读(65) 评论(0) 推荐(0)
摘要:域名注册与解析位于阿里云 安装acme.sh curl https://get.acme.sh | sh 或者 wget -O - https://get.acme.sh | sh 这个自动安装过程完成了以下几个步骤(上面那一步默认已经执行了这个操作,如果成功了,这步省略) 拷贝sh脚本到~/.ac 阅读全文
posted @ 2024-01-11 17:16 朝阳1 阅读(421) 评论(0) 推荐(0)
摘要:location /file { charset utf-8; alias /usr/share/nginx/html/files; #文件根目录 autoindex off; autoindex_exact_size off; autoindex_localtime on; # 按理说只用配置这一 阅读全文
posted @ 2023-11-08 14:12 朝阳1 阅读(204) 评论(0) 推荐(0)
摘要:安装cerbot apt install certbot 执行 you.cn 换成对应的域名 certbot certonly -d *.you.cn --manual --preferred-challenges dns --server https://acme-v02.api.letsencr 阅读全文
posted @ 2023-10-19 17:58 朝阳1 阅读(101) 评论(0) 推荐(0)
摘要:安装htpassed工具 yum -y install httpd-tools 或者 apt install apache2-utils 创建用户名和密码 htpasswd -c /etc/nginx/.htpasswd username 修改nginx配置文件 server { listen ; 阅读全文
posted @ 2023-10-19 15:15 朝阳1 阅读(274) 评论(0) 推荐(0)
摘要:创建服务器证书秘钥文件 [root@Nginx ~]# openssl genrsa -des3 -out server.key 1024 ... Enter pass phrase for server.key: # 输入密码 Verifying - Enter pass phrase for s 阅读全文
posted @ 2023-10-19 14:47 朝阳1 阅读(322) 评论(0) 推荐(0)