Articles of nginx

这是在nginx日志中是什么? “\ X01 \ X01 ……”

我们的日志中有很多这样的请求: [07/Dec/2015:19:37:03 +0000] "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\! x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" 400 172 "-" "-" "-" 我想这是一个安全漏洞,但是我找不到Google。 有没有其他人看过这个或知道它是什么?

突然开始经历了巨大的等待时间,才请求服务器

我们的networking应用程序一天获得20k-30k的观看次数,并且稳步增长。 大约4天前,我们突然开始等待30-40秒的等待时间,之后甚至在前一天还在1秒内渲染HTML。 在新的文物合成中,这些时代简直就是“等待”。 通过监控nginx日志,我可以看到这些时间对应于传入请求到达服务器的时间。 这是一个运行在2GB液滴上的Unicorn&Nginx的Rails应用程序。 我以前根据这篇文章优化我的独angular兽configuration:https://www.digitalocean.com/community/tutorials/how-to-optimize-unicorn-workers-in-a-ruby-on-rails-app,和我们的内存使用量往往徘徊在50%左右。 尽pipe如此,我还注意到在上面的相同的日志输出中的一堆: 2016/03/15 06:52:36 [error] 9460#0: *1110377 connect() to unix:/tmp/unicorn.streamfeed.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 66.226.75.13, server: streamfeed.com, request: "GET /watch HTTP/1.1", upstream: "http://unix:/tmp/unicorn.streamfeed.sock:/watch", host: "streamfeed.com", referrer: "http://google.com/" 在没有任何更好的想法的情况下,我认为可能意味着我们的stream量比独angular兽工人能够处理的stream量要多(我们的stream量一直在稳步增长,而且我们有一天还有最忙的一天)。 所以我把我们的液滴升到了4GB,使麒麟工人的数量增加了一倍,但是这并没有解决它 – 有时候我看到了这11个错误,有时候是110。 这不是我的代码优化的问题 – 一旦请求最终通过,包括任何数据库查询,相关操作仍然需要1-2秒才能实际处理(每New Relic)。 延迟发生在请求甚至到达服务器之前。 我们两个水滴(应用程序服务器和数据库)的CPU使用率都低于50%,内存使用率也是如此。 Unicorn日志中没有错误。 我已经尝试了我在网上find的每一个调整/优化nginx和独angular兽的方法,没有什么区别 – 如果有的话,加载时间不断增加。 我们现在正在等待处理请求的40-50秒,这实际上意味着我们的网站已经瘫痪。 在开始之前,我还没有改变任何相关的设置或代码很长一段时间。 我已经把我的相关文件回滚到开始发生时的状态,因为我所做的任何改变都没有改变。 […]

Nginx + WordPress的子目录

我最近将我们的主页迁移到ASP.NET Core 1.0。 这使我在Linux环境中移动网站。 我们也有这个网站这是一个WordPress的博客/博客。 除了W3 Total Cache之外,所有迁移都正常。 这是我做的。 安装的PHP-FPM和DNX都在Nginx的反向代理之后。 这是文件夹层次结构。 / var / www / aspnet / var / www / wordpress 这里是所有与Nginx相关的configuration文件 /etc/nginx/nginx.conf user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent […]

Nginx无法看到unix套接字

更新:我看到与/ tmp目录相关的问题,以及提到的将注释从/ home移出的注释。 它没有解决这个问题。 (在post底部的附加更新) 我有一个azure色的Ubuntu 16.04虚拟机我正在使用主机使用uwsgi作为服务器和nginx作为反向代理的烧瓶应用程序,按照本指南… https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-04 问题是我得到一个502错误的网关,当我尝试连接到服务器的IP在端口80上的Web浏览器。当我检查日志,它说,Nginx无法find我在configuration文件中指定的Unix套接字。 错误是… 2016/08/29 23:23:20 [crit] 2792#2792: *120 connect() to unix:///home/me/appname/appname/appname.sock failed (2: No such file or directory) while connecting to upstream, client: ip.goes.in.here, server: here.goes.the.ip, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:///home/me/appname/appname/appname.sock:", host: "the.ip.goes.here", referrer: "http://all.of.teh.ips/" 我的服务器块看起来像这样… server { listen 80; server_name ip.address.goes.here; location / { include uwsgi_params; […]

上游过早closures连接,同时从上游502 Bad GateWay读取响应报头

nginx是杀了我..所以现在我有502坏网关。 错误日志说: 2016/10/12 17:39:53 [info] 3023#0: *464 client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0.0:443 2016/10/12 17:39:53 [info] 3023#0: *465 client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0.0:443 2016/10/12 17:39:55 [error] 3023#0: *459 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: local.beerhawk.co.uk, request: "GET […]

Nginx + PHP的最大输出限制

我有php 5.5(fpm)和nginx 1.10安装(gzipconfiguration为1)。 在Ubuntu上运行。 当我“回响”一个大的输出(超过2 MB)时,它会在520 kb左右突然停止。 但是,当我运行在php-cli上的同样的程序,没有任何问题“回声”到terminal上的整个事情。 同时通过adminer下载mysql dump也会在中途停下来。 我的意思是不完整的文件被下载(如果在几个MB中正确的总输出更大)。 如何解决这个问题? 我的程序没有错。 即使是一个简单的足够长的循环喷出回声“你好世界”停止在特定的字节限制。 我不确定这个问题是由nginx侧还是php侧引起的。

ELB和服务器都使用SSL

我把我的ELBconfiguration成能够通过将我的证书放入ELB本身来服务ssl页面。 说ELB服务www.example.com的请求。 同时,我需要在ELB 之外使用ssl,并直接从服务器提供一些内容,而不经过ELB。 在这种情况下,请求将发送到web.example.com。 我怎么能做到这一点,并确保如果SSL服务的ELB从服务器卸载? 考虑到我的networking服务器是nginx。 谢谢,C

服务于nginx和HTTPauthentication下的静态文件

我有一个应用程序部署在服务器上的testing模式。 通过HTTPauthentication将访问权限限制在一组选定的用户中。 这工作正常。 问题是,如果我通过不同的“位置”指令提供静态文件,nginx给了我一个“没有授权”的文件。 我尝试auth_basicclosures,但没有骰子。 这是虚拟主机conf: # Virtual Host upstream appname { server 127.0.0.1:4000; server 127.0.0.1:4001; server 127.0.0.1:4002; } server { listen 80; server_name appname.domain.com; # write app specific log # make sure you create this file in your log directory before running behind nginx access_log /home/apps/appname/shared/log/nginx.log main; # let nginx serve static files directly […]

运行fastcgi-> php的博客子文件夹,而其余的网站是fastcgi-> Django

sorting一个奇怪的问题,但应该很容易解决。 我正在开发一个Django网站,客户也想要一个WordPress的博客。 因为我们在枪下,也有其他项目,所以我们没有时间去build立一个好的django博客,所以我们给他们一个子文件夹的Wordpress。 我有很多使用Nginx的经验,但从来没有做过这样的事情,我也不是非常有才华的正则expression式。 结构如下: blog (the wordpress blog) contact __init__.py manage.py settings.py static (all my static media, htdocs directory) templates urls.py wsgi.py 这是迄今为止超级轻量级​​,只有一个单一的应用程序(联系应用程序)。 我想要域名/博客点击/博客/文件夹和静态媒体对待像静态媒体和PHP文件,如PHP文件代理他们到我的fastcgi进程。 当然,我希望其他所有的东西都能和Django一起工作,进入我的python fastcgi过程。 为了logging,除了这个nginxconfiguration外,一切正常。 我所有的fcgi过程都很好。 这是我的nginxconfiguration: # David Simons Website server { listen 80; server_name ********; root /usr/local/simons/static; index index.html index.php; location / { fastcgi_pass 127.0.0.1:3033; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param REQUEST_METHOD […]

Perlbal的上传处理

perlbal处理上传的方式和方式? 它是否照顾caching整个文件到磁盘有效,然后传递参数或标题到描述文件的后端? 现在,即时通讯使用nginx的上传模块,但我想使用perlbal的X-REPROXY-URLfunction透明地提供cdn文件。