67.nginx动态跨域

发表于 linux 分类,标签:
#nginx屏蔽版本号server_tokens  off;#Cookie设置成HttpOnlyadd_header Set-Cookie "Path=/; HttpOnly; Secure";#防止XSS,下面3行add_header X-Frame-Options "SAMEORIGIN";add_header X-XSS-Protection "1; mode=block";add_header X-Content-Type-Options "nosniff";add_header Strict-Transport-Security&n...

66.gitlab配置

发表于 linux 分类,标签:
1.下载官方包:https://packages.gitlab.com/gitlab/gitlab-ce清华包:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/2.rpm安装:rpm -ivh gitlab-ce-13.6.1-ce.0.el7.x86_64.rpmyum install -y gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm配置yam源方式安装:在/etc/yum.repos.d/下新建gitlab-ce.repo,写入如下内容:[gitlab-ce]name=gitlab-cebaseurl= Repo_gpgcheck=0Enabled=1Gpgkey=https://packages.gitl...

65.http转https

发表于 linux 分类,标签:
Nginx环境下强制http转https设置方法:方法一:下面代码照搬过去就行。无需做任何修改。春哥技术博客推荐此种方法,非常简单,改完以后实时生效,不用重启服务器。if($scheme=http){return301https://$host$request_uri;}方法二:下面代码照搬过去就行。无需做任何修改。if($server_port=80){return301https://$host$request_uri;}方法三:下列代码中请注意把域名修改成自己域名。if($ssl_protocol=""){return301https://$server_name$request_uri;}if($host!=www.kjcwh.com){return301$scheme://www.kjcwh.com$r...

64.nginx_waf

发表于 linux 分类,标签:
配置如下:##如果我是阿里的WAF,ALB,SLB后面,因为阿里已经弄好了$http_x_forwarded_for的第一个ip为客户端iplocation / {access_by_lua_file "/opt/verynginx/openresty/nginx/conf/lua/whiteKeykz18.lua";proxy_set_header xrequestid $xrequestid;proxy_headers_hash_max_size 51200;proxy_headers_hash_bucket_size 6400;proxy_set_header Host       $host...

63.sslscan工具

发表于 linux 分类,标签:
一、sslscan工具安装步骤1.下载源码gitclonehttps://github.com/rbsec/sslscan2.进入目录cdsslscan3.编译安装makestatic4.如果报错就安装一下依赖环境sudoapt-getinstallrubysudoapt-getinstallzlib1gsudoapt-getinstallzlib1g.dev5.查看是否编译成功./sslscan--version6.使用./sslscan--tlsallxxx.xxx.com:443二、忘记root密码如何修改1.启动KaliLinux,在看到蓝色的引导界面时按键盘e进入编辑模式2.在界面"linux/boot/vmlinuz-5.14.0-kali-adm64root=UUID=02f7b3bc-5dd1-4ef0-8ce0-e2...

62.google谷歌翻译

发表于 linux 分类,标签:
香港ip142.250.4.90translate.googleapis.com如果这个香港ip失效了,那就把ip替换下面这些备用的吧,速度稍慢,但是也能用。142.250.110.90 translate.googleapis.com172.217.214.90 translate.googleapis.com108.177.122.90 translate.googleapis.com172.253.114.90 translate.googleapis.com172.217.203.90 translate.googleapis.com172.253.112.90 translate.googleapis.com...

60.crontab配置

发表于 linux 分类,标签:
crontab每分钟定时执行:*/1****servicemysqldrestart//每隔1分钟执行一次*/10****servicemysqldrestart//每隔10分钟执行一次crontab每小时定时执行:0*/1***servicemysqldrestart//每1小时执行一次0*/2***servicemysqldrestart//每2小时执行一次crontab每天定时执行:010***servicemysqldrestart//每天10点执行3019***servicemysqldrestart//每天19点30分执行crontab每周定时执行:010**1servicemysqldrestart//每周一10点执行3017**5serv...

59.定时输出cpu状态

发表于 linux 分类,标签:
#!/bin/bashnow=`date -u -d"+8 hour" +'%Y-%m-%d %H:%M:%S'`#cpu使用阈值cpu_warn='75'#mem空闲阈值mem_warn='100'#disk使用阈值disk_warn='90'#---cpuitem_cpu () {cpu_idle=`top -b -n 1 | grep Cpu | awk '{print $8}'|cut -f 1 -d "."`cp...

58.http代理无css

发表于 linux 分类,标签:
# HTTPS server  server {       listen 80;#       listen 443 ssl;   #SSL协议访问端口号为443。此处如未添加ssl,可能会造成Nginx无法启动。       server_name m.leiuk.com;  #将localhost修改为您证书绑定的域名,例如:www.example.com。#     &...