Nginx 1.9.0 开发版发布,该版本增加了 stream module 用于一般的 TCP 代理和负载均衡。 下载地址: nginx-1.9.0 nginx/Windows-1.9.0 其他改进包括: *) Change: obsolete aio and rtsig event methods have been removed. *) Feature: the zone directive...
简单介绍一下他的安装及配置过程 官方网站 http://wiki.codemongers.com/Main 一、依赖的程序 1. gzip module requires zlib library 2. rewrite module requires pcre library 3. ssl support requires openssl library 二、安装 ./configure make make ins...
修改服务器上的nginx的配置文件 /usr/local/nginx/conf/nginx.conf http { limit_req_zone $binary_remote_addr zone=one:10m rate=3000r/m; proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; proxy_temp_path...
今天在配置Nginx+SSL的时候出现如题的错误,后来与度娘一番云雨之后找到一个解决方法,挺有用,随手转之。 一般在vhost的配置中会有php解析的一段,如: location ~ .*\.(php|php5)?$ { try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_p...
使用Nginx时,如果要让一些附件比如 txt,pdf,doc等不直接在浏览器打开,而弹出另存为的对话框(也就是下载) 则可以在nginx的加上头配置如下: if ($request_filename ~* ^.*?\.(txt|pdf|doc|xls)$){ add_header Content-Disposition: attachment;; } 如果客...
代码如下: location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://mmt; if ( $remote_addr != 192.168.0.2 ) { access...
location /nginx-status { stub_status on; #access_log /var/log/nginx/mmt_nginx_status.log; access_log off; allow 192.168.0.10; deny all; #auth_basic NginxStatus; } 访问URL:http://192.168.0.11/nginx-status 结果: Active connections: 178 serv...
Nginx 中的 Location 指令 是NginxHttpCoreModule中重要指令。Location 指令比较简单,但却是配置 Nginx 过程中不得不去了解的。 Location 指令,是用来为匹配的 URI 进行配置,URI 即语法中的/uri/,可以是字符串或正则表达式。但如果要使用正则表达式,则必...
对于批量添加虚拟主机的需求,Apache 有 vhost_alias 模块帮忙。Nginx 呢?其实神马都不需要,同样可以实现 Nginx 二级域名匹配子文件夹,且不匹配 www,但可以匹配包含 www 的子域名。 首先看看目前网上搜到的方法。 复制代码 代码如下: if ( $host ~* (.*)...
最近一次安全培训,需要用到安全攻防平台,结果30几个人登录上去直接爆出500错误。不知道什么原因,后来找来SSH登录用户,密码,逐步排查,发现了Nginx worker_connections配置问题。 原来是Nginx配置文件中的worker_connections配置太低,只有50,导致与php-...