Articles of nginx

Nginx内存不足,不加载新的虚拟主机?

我有一个在debian上运行的nginx。 Nginx将每2分钟刷新一次以获取新创build的虚拟主机。 过了一段时间,新的虚拟主机不再加载,但老的虚拟主机仍然由nginx提供服务 在我的nginx错误日志中,我可以find多个错误。 2014/08/10 06:30:05 [alert] 27891#0: epoll_ctl(1, 4) failed (9: Bad file descriptor) 2014/08/10 06:30:05 [alert] 27892#0: close() channel failed (9: Bad file descriptor) 2014/08/10 06:30:05 [alert] 27893#0: close() channel failed (9: Bad file descriptor) 2014/08/10 06:30:19 [alert] 4806#0: worker process 27891 exited with fatal code 2 and can not be respawn 2014/08/10 […]

jenkins没有可用的插件列表/无法更新

我刚在Ubuntu 12.04LTS上安装了Jenkins 1.575。 当我去插件部分添加插件,什么也没有显示。 如果我去高级并点击现在检查,它只是挂在更新…. 我正在运行nginx进行端口80到jenkins运行的端口8080的代理通行证。 我不太了解configurationnginx。 当我第一次开始jenkins,我有反向代理错误,但驳回它。 不知道这是否相关。 我也曾经运行,但禁用,没有帮助 我也没有看到jenkins日志中的任何错误 我与Jenkins有关的nginx.conf: http { server { listen 80 default; server_name _; location /{ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:8080/; proxy_set_header X-Real-IP $remote_addr; proxy_redirect http://localhost:8080 $scheme://localhost; } } ….. 任何线索如何解决这个问题?

Nginx的memcached_pa​​ss指令未知

我正在AWS上设置一个新的服务器实例,并遇到了一些我不知道如何处理的东西。 我之前和之后在数字海洋上设置了完全相同的configuration,根本没有发生问题。 当我执行nginx -t来检查configuration时,我回到了包含memcached_pass的行的引用(请参阅下面的confconfiguration)。 nginx: [emerg] unknown directive "memcached_pass" 我是否缺less一些需要安装的软件包? 检查了文档,但不能真正find任何可以解释这一点的东西。 这是我在其他服务器上的Ubuntu上使用的相同的设置。 我知道的机器之间的唯一区别是Ubuntu版本14.04.1 LTS和12.04.4 LTS在那些工作。 这会有什么影响吗? configuration: location /embed/view { default_type "text/html; charset=utf-8"; set $memcached_key $uri; memcached_pass 127.0.0.1:11211; error_page 404 502 @fallback_embed; }

将Zend Framework 2从apache移动到nginx

我想将使用Zend Framework 2的站点从Apache移动到Nginx。 问题是该站点有6个模块,并且apache通过在httpd-vhosts.conf中定义的别名来处理它, #httpd-vhosts.conf <VirtualHost _default_:443> ServerName localhost:443 Alias /develop/cpanel "C:/webapps/develop/mil_catele_cp/public" Alias /develop/docs/tech "C:/webapps/develop/mil_catele_tech_docs/public" Alias /develop/docs "C:/webapps/develop/mil_catele_docs/public" Alias /develop/auth "C:/webapps/develop/mil_catele_auth/public" Alias /develop "C:/webapps/develop/mil_web_dicom_viewer/public" DocumentRoot "C:/webapps/mil_catele_homepage" </VirtualHost> 在httpd.conf中DocumentRoot被设置为C:/ webapps。 例如localhost/develop/cpanel站点。 框架处理更多的路由。 在Nginx中,我只能通过指定root C:/webapps/develop/mil_catele_tech_docs/public; 在服务器块。 它的工作原理只是因为docs模块不像其他人那样依赖auth,而且site是在localhost/ 。 在下一次尝试中: root C:/webapps; location /develop/auth { root C:/webapps/develop/mil_catele_auth/public; try_files $uri $uri/ /develop/mil_catele_auth/public/index.php$is_args$args; } 现在,当我进入localhost/develop/cpanel它得到正确的index.php,但无法find任何资源(CSS,JS文件)。 我不知道为什么浏览器的GET请求中的引用path更改为https://localhost/css/bootstrap.cssformshttps://localhost/develop/auth/css/bootstrap.css因为它在apache上。 这根指令似乎不工作。 Nginx使用fastCGI处理php location ~ […]

光油中断与Invision电源板login

我最近把我的主要网站之一转移到WordPress安装,但不幸的是,这导致了非常高的服务器负载。 最初,我运行一个基本的LAMP服务器与几个网站。 我现在主要关心的是一个网站,每天点击6万次点击,并且有一个非常活跃的使用Invision电源板的论坛。 这使我现在到了现在。 我换了nginx的apache,优化了一下MySQL,并安装了Varnish。 这帮助了很多,除了我的Invision电源板安装以外的其他一切工作。 无论出于何种原因,IPB将不再允许我login或注销。 在我login的其中一台计算机上,我可以保持login状态。但是,如果我尝试从另一台计算机或浏览器login到ACP或论坛,则无法工作。 以下是我在Varnish中的设置: sub vcl_recv { if (req.http.host ~ "^(www\.)?domain1\.net$") { set req.http.host = "domain1.net"; set req.backend = domain1; return (lookup); } if (req.http.host == "old.domain1.net") { #You will need the following line only if your backend has multiple virtual host names set req.http.host = "old.domain1.net"; set req.backend = […]

定期连接超时到nginx服务器

我们有以下设置:一个nginx服务器作为四个工作应用程序服务器前面的负载平衡器。 nginx服务器每秒获得约100个请求,有时更多的是,活动连接平均hover在110。 在一个比较有规律的间隔(1-2秒)内,访问nginx负载均衡器的应用程序会得到一堆TCP连接无法build立的失败请求(连接超时)。 问题很快就解决了,下一批连接处理正常,直到下一次连接超时。 我认为,这不是一个巨大的负载和nginx应该没有处理它的问题。 我的第一个猜测是基于互联网上的各种帮助页面调整ipv4的sysctl设置,但迄今为止没有效果。 我已经增加了端口范围,并将fin_timeout降低到30.在netstat(〜11k)中显示了很多TIME_WAIT连接。 有没有人有一个想法在这种情况下做什么? 我意识到可能没有定义什么实际问题的答案,但指针是赞赏! 谢谢!

安装gitlab后,nginx不能重新启动

我在ubuntu服务器(14.04)中安装了nginx(1.6)。 之后,我安装了gitlab。 我没有意识到它有自己的nginx。 我稍后卸载gitlab。 安装gitlab之后,我的第一个nginx开始从不作为服务启动。 意即: 如果我打sudo netstat -anp我没有看到在0.0.0.0:80相应的条目。 如果我打sudo nginx -s reload ,然后sudo netstat -anp我看到我提到的相应的条目。 我以为我可以通过这样做来修复它: sudo update-rc.d nginx remove sudo update-rc.d nginx defaults 删除gitlab后,但它没有帮助我(即重新启动后,nginx不会自动启动)。 我修改了/etc/init.d/nginx ,看看$DAEMON仍然是/usr/sbin/nginx 。 问题 :我应该在什么地方查看问题(或者问题是什么)? sudo nginx -s reload工作没有任何问题。

PHP运行在服务器上,但不是命令行:“libssl.so.10:没有可用的版本信息”

PHP正在我的服务器上运行,但我无法让它运行命令行。 我运行这个文件: <?php echo "done"; ?> 使用这个命令: php test.php 当我这样做,我得到这个错误: php: /usr/lib64/libssl.so.10: no version information available (required by php) 任何想法,为什么这可能是? 服务器是活的,所以我希望在进行任何可能会破坏我的设置的更改之前了解这里发生了什么。 我需要PHP来运行命令行,所以我可以得到一个电子邮件接收脚本工作。 我在nginx上运行php-fpm。 感谢任何指针 –

nginx不检查websocket代理上的server_name和端口

我有三个服务器块(虚拟主机)的http和一个websocket在nginxconfiguration(nginx 1.6.0,Ubuntu 14.04)。 server { listen 80; listen [::]:80; server_name h3400.domain.com; location / { proxy_pass http://localhost:3400/; proxy_http_version 1.1; proxy_set_header Host $host; } } # this one for websocket on ws://h3400.domain.com:3000/ server { listen 3000; listen [::]:3000; server_name h3400.domain.com; location / { proxy_pass http://localhost:3001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass […]

Rails json请求很慢

我正在开发与Rails作为后端angularjs应用程序。 它由DigitalOccean最小的服务器托pipe。 在我的生产系统中,只有我现在正在testing。 问题是请求需要相当长的时间,我不知道时间在哪里丢失。 例如 我做了一个JSON请求到后端。 大约需要500毫秒。 该请求是gzipped。 在rails网站上,我使用rabl来进行json响应。 我对服务器的ping大概是30毫秒 导轨请求在100毫秒内在服务器上呈现。 400毫秒的时间在哪里? 有任何想法吗? 我有两个屏幕截图来自chrome timing和rails log。 Rails版本4.1.4 Ruby 2.1.0 nginx 1.6.0 Ubuntu 12.04 Postgres 9.2 Angularjs 1.2.21 独angular兽