Articles of nginx

ELB,nginx和多个HTTPS应用程序

比方说,我有3个不同的应用程序,都做HTTPS。 不是所有这些都是高stream量,所以我在3个EC2实例的同一个“池”上运行全部3个。 domain1.com/domain2.com/domain3.com都有他们的Alogging指向Amazon ELB,它在所有三台服务器上都转发:443和:80到nginx:80(所以是的,ELB做SSL终止)。 因为ELB正在做SSL终止,所以我有三个不同的ELB,而不是一个 。 所以基本上: domain1.com domain2.com domain3.com | | | | | | VVV ELB1 ELB2 ELB3 \ | / \ | / \ | / \ | / \ | / \ | / \_______|_______/ | | V ————————— nginx nginx nginx | | | VVV php-fpm php-fpm php-fpm 三个实例中的每一个都运行nginx和php-fpm。 这样,当负载太高时,我们只是从同一台机器镜像启动另一个实例,它只是join池。 […]

如何降级Debian上的nginx?

由于file upload模块在nginx 1.2.1版本中退出,但从1.3.x版本开始被忽略 ,所以我想在Debian上将当前的nginx 1.4.2降级到1.2.1,这样我就可以很容易地创build这个模块了。 我想知道什么是最容易做的降级。 另外我想知道是否会有一些严重的安全缺陷,因此不build议。

SPDYCheck说“耶”,但我的浏览器说“不”?

SPDYcheck.org全面赞扬,唯一的批评是 Out-of-Date SPDY Protocol Support The most recent version of SPDY is spdy/3. The highest version this website supports is spdy/2. There are 3 major versions of SPDY. This website should consider updating its software if possible to support spdy/3. (Nginx 1.5.6,openSSL 1.0.1e – 我觉得这两个版本都是最新的,如果我想要,我怎么能得到spdy / 3呢?) 但是当我在浏览器中查看时,通过 chrome://net-internals/#events&q=type:SPDY_SESSION%20is:active 它不显示。 其他网站,如谷歌等DO。 我还安装了一个Chrome扩展,如果检测到SPDY,则会在地址栏中放入绿色闪电。 Google =绿色螺栓。 我的网站=没有绿色螺栓。 […]

Nginx限制推荐人的速度?

我已经成功地设置了IP地址的速率限制, limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; 但我想知道是否有可能做同样的推荐人? 例如,如果一个网站被放置在第三方网站上的iframe中,会产生太多的stream量来处理。 我找不到任何地方的引用的任何nginxvariables。 我不想完全阻止stream量,只是限制来自iframe的stream量。 这可能吗? 或者可以用不同的方式实现解决scheme? 谢谢。

NGINX不提供CSS和JS

NGINX不会向浏览器提供CSS或JS文件 链接到页面(magento) http://836237.vps-10.com/ 访问日志显示: [01/Dec/2013:16:55:17 +0000] "GET /js/varien/form.js HTTP/1.1" 304 0 "http://836237.vps-10.com/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36" 错误日志显示没有错误。 以下是我的虚拟主机文件: server { listen 80 default_server; server_name 836237.vps-10.com; root /data/www/public_html/hotnstylish/public/; #charset koi8-r; access_log /data/www/public_html/hotnstylish/log/access.log; error_log /data/www/public_html/hotnstylish/log/error.log; location / { include /etc/nginx/mime.types; root /data/www/public_html/hotnstylish/public/; index index.html index.htm index.php; try_files $uri $uri/ @handler; ## […]

Nginx代理不会将控制器/操作结构中的url传递给Apache2

我使用Nginx作为Apache2的代理。 目前的configuration工作,我可以访问该网站。 然而,PHP应用程序是基于Zend Framework 2构build的,依赖于/ controller / action / structure中的url,并不会传递给Apache2。 这导致从主页到子页面的每个链接都被破坏,并redirect到我们的“找不到页面”页面。 传递给Apache2的url是/index.php而不是/ controllerX / actionY Nginx(VirtualHost)configuration server { listen 80; root /var/www/talentina_dev/talentina-alpha-temp/public/; index index.php index.html index.htm; server_name dev-aws.talentina.com; location / { try_files $uri $uri/ /index.php; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080; } location ~ \.php$ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header […]

我怎样才能用nginx密码保护一个目录,而不是目录中的文件?

我知道这可以用Apache来完成,但是我已经开始使用nginx了,想知道这是否可行,如果可以的话,我该如何实现它。 在我的networking服务器上,我有目录/ mcscreens其中包含一些图像。 该目录用h5ai索引。 我想密码保护目录,所以我可以访问/ mcscreens,login,并能够使用h5ai浏览所有的图像。 我也想直接把人们链接到特定的图像,而不需要进行身份validation。 基本上,我想密码保护目录,但不是单个文件。 我怎样才能做到这一点? 编辑:我的完整configuration,包括rmalayter的例子: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www; index index.php index.html index.htm /mcscreens/_h5ai/server/php/index.php; # Make site accessible from http://localhost/ server_name redacted; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a […]

在哪里可以findFCGI应用程序的FreeBSD nginx coredump文件?

我在FreeBSD上运行nginx上的FCGI spawn应用程序。 它是越野车,我想分析崩溃的.core文件。 但是我没有任何线索在哪里产生。 有人知道吗?

你怎么能调查每天的stream量消耗?

运行Amazon EC2实例,t3.large层。 并观察有趣的情况: 每晚(UTC + 1午夜)都会发生相同的NetworkOut跳转。 我有什么select来调查它? EC2只运行nginx和varnish。 Nginx的访问日志不会显示任何类似的内容。 所以它一定是不同的。

根据参数redirect

我试图根据传递的参数redirect页面。 我想redirect 重写^ / join_trial到/ test? 常驻; 和 重写^ / join_trial?discount = free(。*)/ test2? 常驻; 第一个工作,但第二个不工作。 看起来nginx不需要(。*)正则expression式。 对于第一个,下面的案例工作。 / join_trial?testing= AAAAA / join_trial?923849 = AAA 基本上,你可以把任何东西放在/ join_trial之后 。 我想在用户追加时有一个redirect?discount = free (任何东西都在这里)。 这可能与Nginx?