Articles of nginx

Nginx查询关键字匹配的位置

我有以下 location ~ "/foo/(.+)\.\w{3}$" { alias /srv/DM/pictures/store/$1; } 这正是我想要的,只有一个例外。 如果有一个查询关键字追加到我希望它不匹配的位置: MATCH: http://foo/bar.jpg NO: http://foo/bar.jpg?s_thumb NO: http://foo/bar.jpg?large_thumb 任何想法如何去完成这个?

在Ubuntu 10.04上安装dpkg错误

我试图在ppa:nginx/stable上安装nginx ppa:nginx/stable在Lucid后,删除来自默认源,但我得到这个错误: 设置nginx-common(0.8.54-4ppa13〜lucid)… dpkg:error handlingnginx-common(–configure): 安装后的subprocess脚本返回错误退出状态1 dpkg:依赖关系问题阻止configurationnginx-full: nginx-full取决于nginx-common(= 0.8.54-4ppa13〜lucid); 然而: 软件包nginx-common尚未configuration。 dpkg:error handlingnginx-full(–configure): 依赖问题 – 留下未configuration dpkg:依赖关系问题阻止了nginx的configuration: nginx依赖于nginx-full; 然而: 软件包nginx-full尚未configuration。 dpkg:处理nginx错误(–configure): 依赖问题 – 留下未configuration 处理过程中遇到错误: nginx的常见 nginx的全 nginx` 我已经尝试apt-get clean,dpkg –configure -a,apt-get -f install nginx-common,但没有任何帮助。 我错过了什么吗? 这是dpkg-query -W -f='${Package}\t${Version}\n' nginx* `nginx 0.8.54-4ppa13〜清楚 nginx-common 0.8.54-4ppa13〜清楚 nginx的,额外 nginx-full 0.8.54-4ppa13〜清楚 nginx的-light`

任何证书颁发机构是否都支持SAN和通配符?

我的基本困惑是通配符证书不支持子域的子域,也不能帮助replace域名。 基本上,如果我的CN是example.com ,我想要一个主题备用名称字段,看起来大致像这样: DNS:example.com DNS*.example.com DNS:*.beta.example.com DNS:example.net DNS:*.example.net DNS:*.beta.example.net 使用自签名的证书,我证实了浏览器将正常工作。 不幸的是,我看到的证书颁发机构(Thawte,GoDaddy,Verisign,Digicert)似乎都支持通配符证书和 Subject Alternative Name(有时称为“多域UCC”)。 我甚至打电话给GoDaddy技术支持人员确认。 是否有一个支持通配名的通配符的CA(受99%的浏览器信任)?

正确的uWSGI进程数量?

在一个4芯的盒子上,哪个场景设置得更好: 4 uWSGI用深队列处理请求 8个具有深队列的uWSGI进程 像服务器的内存一样,许多进程允许一个相对较浅的队列?

nginx用于本地开发

我想用nginx进行本地开发。 这意味着我想阻止其他机器访问我的Web服务器,因此只能通过本地主机访问。 在sites-enabled / default的服务器设置下,我将代码更改为 location / { # First attempt to serve request as file, then # as directory, then fall back to index.html allow 127.0.0.1; deny all; try_files $uri $uri/ /index.html; } 还有什么我需要做的,以防止第三方访问我的networking服务器?

不断增加的内存使用情况由PHP的FMP?

似乎php-fpm正在分配越来越多的内存,虽然峰值和下降的请求量。 无法发布多个图片,所以我把它们放在这里 。 正如你可以看到在图片的uri中,一个图片nginx请求,显示明显的下跌和高峰。 其他的,每个孩子的php-fpm记忆和平均记忆似乎并没有遵循相同的模式。 只有重新启动php-fpm才能起作用,即使如此,我也不能说我注意到了性能的任何变化。 系统是好的,响应时间是好的,一切都很好,只是好奇,如果这是预期的行为,并且如果它有性能好处或应该避免(通过降低max_requests什么?)。 系统运行Debian GNU / Linux 6.0 Squeeze,AMD64。 PHP版本5.3.6。 PHP 5.3.6 pool.d / www.conf: pm.max_children = 50 pm.start_servers = 30 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 1024 我已经得到了这些在php-fpm.log,因为它是新鲜安装的: [28-Jun-2011 14:45:39]警告:[池www]孩子1893年从信号9(SIGKILL)退出后从22296.217811秒开始 [28-Jun-2011 14:45:39]通知:[池www]孩子18391开始 [28-Jun-2011 14:45:39]警告:[池www]子1903从信号9(SIGKILL)退出后从22296.213677秒 [28-Jun-2011 14:45:39]通知:[池www]孩子18392开始 [28-Jun-2011 14:45:39]警告:在启动22296.213757秒后[pool www]子1904在信号9(SIGKILL)上退出 [28-Jun-2011 14:45:39]通知:[池www] 18393孩子开始 [28-Jun-2011 14:45:39]警告:在启动22296.214307秒后[pool www]子1905在信号9(SIGKILL)上退出 [28-Jun-2011 14:46:20]注意:fpm正在运行,pid 18410 […]

即使正则expression式匹配,fail2ban也不会处理jail

我有麻烦设置fail2ban检查nginx错误日志中的失败httpvalidation条目。 即使提供的failregex工作,fail2ban似乎跳过了监狱configuration。 我已经尝试将loglevel设置为4,但没有关于nginx监狱的任何失败的信息。 此外,我想在日志文件中的时间戳必须匹配系统时间,这当然是事实。 奇怪的是我设置的其他监狱(ssh)完美。 我没有想法,也许你有一个。 这里是希望你所需要的所有信息。 谢谢。 fail2ban.conf [Definition] loglevel = 3 logtarget = /var/example/logs/fail2ban.log socket = /var/run/fail2ban/fail2ban.sock jail.conf [DEFAULT] ignoreip = 127.0.0.1 bantime = 60 findtime = 600 maxretry = 3 backend = auto [ssh-iptables] enabled = true filter = sshd action = iptables-allports[name=SSH, protocol=all] logpath = /var/log/auth.log [nginx] enabled = true filter […]

如何在运行nginx时停止irdmi?

每次运行nginx监听端口8000,由于地址已经被使用,所以不能绑定,所以我运行: lsof -i:8000 ,它显示: nginx 27156 marconi 6u IPv4 58814 0t0 TCP *:irdmi (LISTEN) 我可以杀死它,但开始nginx获得产卵,再次处理。 到底发生了什么,我该如何阻止呢? 这曾经工作之前,irdmi不显示,但我不知道我做了什么。

Ubuntu + Nginx 127.0.0.1的作品,但本地主机不

这个很奇怪,因为我没有任何错误信息。 我有一个非常基本的默认文件: server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 root /var/www; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name localhost; access_log /var/log/nginx/default.access_log; error_log /var/log/nginx/default.error_log warn; location / { # First attempt to serve request as file, then […]

拒绝全部被另一个位置块覆盖

location /_private { deny all; } location ~ \.php$ { # Workaround PHP vulnerability: # http://forum.nginx.org/read.php?2,88845,page=3 try_files $uri =404; include /etc/nginx/fastcgi_params; keepalive_timeout 0; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/tmp/php.socket; } 我想拒绝访问所有的东西,这是在_private目录。 当我尝试访问_private/a ,我得到403错误,就像应该。 但是当我尝试访问_private/b.php , deny all部分被完全忽略。