包含标签 nginx articles

nginx网站镜像--HttpSubsModule

前两天在iredmail官方群里看到iredmai.org被人镜像了。使用的工具很简单nginx+一个第三方模块(apache也有同样的模块,而且较nginx的更早有,后面会提到) --成本低廉,配置简单,功能强大。是盗站镜像必备之良器。这里对此做个总结。 关于nginx的镜像功能的……

Continue reading

Deny Hosts Using Nginx

I was noticing my nginx log file fill up with requests for a site who had misconfigured their DNS. Normally I wouldn’t worry about it, but it became quickly evident that the domain was used for an image server for a parent site. There were thousands of RPS that I really didn’t need. All I did was add the following expression to my nginx.conf file. 1Server { 2 ...snip... 3 ## Deny illegal Host headers 4 if ($host !~* ^(mydomain.com|www.mydomain.com)$ ) { 5 return 444; 6 } 7 ...snip... 8} Now if you look at the code, you may be thinking “But Jared, what is a 444 error? That is totally not valid bro.” And indeed, you are correct. But here is what the nginx documentation has to say about it. _“Furthermore, nonstandard code 444 closes the connection without sending any headers.……

Continue reading

使用nginx进行cache缓存

一、nginx cache配置 1、nginx.conf 主配置文件 这个基本按默认配置做的,如果是生产环境可以再加上只允许通过的域名访问,不允许的403或转到其他页。另外进程数和连接数也要做相应修改。 1worker_processes 1; 2events { 3 worker_connections 1024; 4} 5http { 6 include mime.types; 7 default_type application/octet-stream; 8 sendfile on; 9 keepalive_timeout 65; 10 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 11 '$status $body_bytes_sent "$http_referer" ' 12 '"$http_user_agent" "$http_x_forwarded_for"'; 13 access_log logs/access.log main;……

Continue reading

使用ssl_session_cache优化https下Nginx的性能

网站启用https后,会加剧服务器的负担。每次新的TLS连续都需要握手,以便创建共享的加密密钥,在TCP三次握手之上还需要两个来回。传统的http使用TCP三次握手建立连接,而SSL和TLS在这个基础上还需要9个握手包,所以这个负担显而易见。不过,通过重用Session提高htt……

Continue reading

Nginx伪静态规则大全(wordpress/discuz/ecshop/phpwind/dedecms)

Nginx一个非常高效的HTTP服务器软件,虽然在使用上很高效、稳定、快速,但是唯一的缺点就是伪静态规则比较复杂,很多新手使用Nginx总是被伪静态规则难倒了,下面我提供一下目前常见各种网站程序的Nginx伪静态规则,希望能帮到大家。 建议大家在下面找到自己需要的伪静态规则,然后保……

Continue reading

Apache和Nginx下禁止访问特定的目录或文件

出于安全考虑,在apache上经常需要做规则限制,禁止访问某些目录。但是假如别要知道该目录下某些文件名,还是可以访问这些文件的。如,禁止了test目录的访问,打开http://www.domain.com/test/时访问会报403错误 。不过如果该test下有passwd.txt……

Continue reading

logrotate进行nginx的日志轮转

logrotate是linux下自带的日志轮询工具。默认情况下,在/etc/cron.daily/目录下有一个logrotate脚本,我们只要把nginx的轮询脚本放在/etc/logrotate.d/下即可。 1# cat /etc/logrotate.d/nginx 2/usr/local/nginx/logs/*.log { 3daily 4missingok 5rotate 7 6compress 7delaycompress 8notifempty 9sharedscripts 10postrotate 11 kill -USR1 `cat /usr/local/nginx/logs/nginx.pid` 12endscript 13} 注:同样可以发送HUP信号来……

Continue reading

nginx cache查看命中率

nginx在web应用上的占用率越来越高,其带的模块也越来越来。nginx_cache算是一个,虽和专业的cache工具相比略逊一筹,但毕竟部署简单,不用另装软件和资源开销,所以在web cache中也占了比重不小的一席。不过像squid和varnish等cache软件都自带的有c……

Continue reading

nginx下开启ssi支持

一、简介 SSI(Server Side Include),是一种类似于ASP的基于服务器的网页制作技术 。将文本、图形或应用程序信息包含到网页中。例如,可以使用 SSI 包含时间/日期戳、版权声明或供客户填写并返回的表单 。 举一个简单的例子:在我们有N多静态页时 ,每年都需要将“版权所有2008-2014”这样的时间信息……

Continue reading

nginx服务器防sql注入与溢出(二)

上一篇——nginx服务器防sql注入与溢出(一) 列出了常用的进行注入与溢出的各种防止方法。但是上文列出的是普遍的方法,针对各自现网应用的不同,使用上也需要进行相应的调整。下面列出一下我现网中的防止方法。 一、自动防护 1if ($request_uri ~* .(htm|do)?(.*)$) { 2 set $req $2; 3} 4if ($req ~* "(cost()|(concat()") { 5 return 503; 6} 7if ($req ~* "union[+|(%20)]") { 8 return 503; 9} 10if ($req ~* "and[+|(%20)]")……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI AWS Ansible Atlassian Azure BMC Blockchain Brocade CDH5 CL210 Cobbler Confd C语言 DDOS DISTINCT DNS Duckdb EKS ELK GCP Ghost Git Glusterfs Go Godaddy Grafana HBA HCIE Hotspot HttpWatch IBM IIS IOS InfluxDB Ingress InnoDB JavaScript Jinja2 KVM Keepalived Mplayer MySQLdb Netlify OpenResty PM PostgreSQL QoS RH318 RH442 RHCA RHCE RHEV RSA SRE SecureCRT Statuscode SublimeText2 TC Telecom Tencentcloud VBA aira2 alpine android anpic apache apm apparmor appfog apr apt-get aria2 array atop audit awk awstats axel backdoor backup bamboo bash bat benchmark bigdata bin bind bitwise book bootstrap bsd c1000 cache capistrano catlog centos centos7 chatops chattr check_mk checkinstall cisco clearall clickhouse cloud-desktop cmdb cms collectd comm compress conver corosync cpu crontab crunchbang css curl date decode dell desktop devops df dhcp diff diskpart django docker dos2unix dpkg drupal etcd excel fail2ban fastcgi fdisk fiddler find firewalld flask flvtool ftp function fuser geek gin github gitlab glances golang google gooupadd graphviz gravatra grep grub2 hadoop haproxy hardware heartbeat helm hexdump hhvm history html http/html/web httplogs https huawei huaweicloud hugo icmp iconv ifconfig inotify iopp ipmitool iptables iredmail iscsi isito it-news java jdk jenkins jira join joomla k3s k8s kdump kernel kingate lamp last leetcode lib light-http linux linux高级篇 ln ls lsi lsof lvm lvs mac mail man mark markdown matplotlib maven memcached microservice mimikatz mkdocs mkpasswd mmonit mod_jk mongodb monit monitor mono moodle mosh mount mpm mrtg mtr my.cnf mysql mysqlbinlog mysqld_multi mysqldump mysqlhotcopy nagios nc nethogs nexus nfs nginx nmon nocatlog node.js nrpe ntfs ntop ntp obs ocr open-falcon openbox opencv openldap openssl openstack oracle oswatch paas pacemaker pam pandas parted pcp pcre pdf percona perl pexpect pgrep php php-fpm ping plsql develope postfix powershell prettify proc prometheus puppeteer pushd pwgen pxe pyecharts python python模块 radmin raid rdesktop read redhat redis redmine regex rh134 rhel7 rhel8 rm rman rootkit route rpm rpmforge rrdtool rsync rsyslog safe saltstack samba scapy screen sed selenium selinux seo seq session set shc sheepdog shell shopt sitemap skydns smokeping snffier snmp socket soft sort spider sql sqlserver squid ss ssh sshpass strace strings su sudo suse svn sysbench syslog-ng sysstat systemd t tar tcpcopy tcpdump tech telnet tengine test testlink threads time tmux tomcat touch tr tsar twisted ubuntu udev ulimit unix unixbench user-agent useradd varnish vbs vercel vi vim visudo vmstat vmware vnc voice vpn vscode vsftp vsftpd vue watchdog web webcam webistrano wget wiki windows wol wordpress workshop wsl x-windows xampp xcache xmllint xtrabackup yule yum zabbix zeromq zip zonetime zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 意林 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta