Articles of nginx

Nginx:未知指令“ngx.flush(true)”

我在使用nginx devel(ndk)和lua-module时遇到了一些麻烦。 我使用以下configuration编译nginx-rpm: ./configure \ –prefix=%{_sysconfdir}/nginx/ \ –sbin-path=%{_sbindir}/nginx \ –conf-path=%{_sysconfdir}/nginx/nginx.conf \ –error-log-path=%{_localstatedir}/log/nginx/error.log \ –http-log-path=%{_localstatedir}/log/nginx/access.log \ –pid-path=%{_localstatedir}/run/nginx.pid \ –lock-path=%{_localstatedir}/run/nginx.lock \ –http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp \ –http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp \ –http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp \ –http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp \ –http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp \ –user=%{nginx_user} \ –group=%{nginx_group} \ –with-http_ssl_module \ –with-http_realip_module \ –with-http_addition_module \ –with-http_sub_module \ –with-http_dav_module \ –with-http_flv_module \ –with-http_mp4_module \ –with-http_gzip_static_module \ –with-http_random_index_module \ –with-http_secure_link_module \ –with-http_stub_status_module \ […]

如果后端服务器closures,AWS ELB,HAProxy或nginx会删除连接吗?

我想知道哪些下列负载均衡器能够检测到不可用的后端机器,并将连接redirect到另一台服务器而不丢失请求: nginx的 AWS Elastic Load Balancer HAProxy的

可能有2个nginx位置块具有相同的匹配标准?

例如,如果我想从caching定义块中分离出防止的热链接块,并将它们放在由main.conf包含的单独的.conf文件中,那么nginx是否只匹配第一个? location ~* \.(?:jpg|jpeg|gif|png|ico)$ { valid_referers none blocked somedomain.com; if ($invalid_referer) { return 403; } } … location ~* \.(?:jpg|jpeg|gif|png|ico)$ { expires 1M; add_header Cache-Control "public"; }

Nginx 504压缩/解压缩和移动文件时超时

我们在Wordpress中获得了504个超时时间,并附带了一个“发布post”function,该function会将受到攻击的zip文件解压缩,将解压缩的文件移至s3,制作一个新的Zip并将其移至S3。 在更大的文件在60秒后超时。 现在我可以在这里明确这个ISNT的用户function – 当用户做任何事情时,这不会发生在网站的前端。 用户将内容图像,邮编等上传到pipe理面板中等待我们的post。 在审核之后,我们可以select删除post(删除他们同时上传的所有数据),或发布post,然后将其上传的zip,解压缩,检查病毒,删除任何不是M​​P3的东西,上传个人的MP3到S3,创build一个新的zip文件,并上传到S3。 这全部来自EC2。 正如你可以想象的那样,虽然这不会给服务器CPU带来太多负担,但是将所有这些数据移到S3通常需要60秒以上的时间。 所以我已经看到了如何防止与Nginx的网关超时的build议 我已经把fastcgi_read_timeout放到了我的nginx.conf中,并将其设置为2700,以避免所有超时错误。 我还添加了该页面上提到的client_body_timeout和send_timeout。 但是这个过程仍然在60秒内超时。 我可能把它们放在nginx.conf的错误的地方(它重新启动没有问题)使用错误的时间,或者有另一个function,将允许此PHP过程完成。 我只要能设置它们,我就拥有所有的php-fpm时间。

将.htaccess http授权转换为nginx

我需要将以下.htaccessstring转换为nginxconfiguration: RewriteRule .* – [E=REMOTE_USER:%{HTTP:Authorization}] 谁能帮我? 我正在运行nginx + php_fpmconfiguration。

ngnix启动isse ipv4&ipv6

我试图得到我的第一个nginx服务器设置,并且无法设置ipv4和ipv6。 我有这个在我的configuration文件的顶部(这是configuration文件中唯一的服务器块): server { # Listen for requests on these ports listen 80 default; listen [::]:80 default_server; } 这是我尝试启动ngnix时得到的错误: * Restarting nginx nginx nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in […]

Nginx的代理按字母表

我有三个VPS服务器,每个都有自己的IP地址。 Server One应该是一个代理服务器,它将监听domain.com和*.domain.com 。 是否有可能configuration第一个VPS,以便如果客户端要求从A到O的信件(例如demo.domain.com或buddy.domain.com )开始的任何子域,它们将被发送到服务器二,如果子域从P开始到Z他们得到发送到服务器三?

用nginxredirectfeed

我想将我的Feedredirect到Feed服务。 使用这个,我只能redirectmysite.com/feed而不是mysite.com/feed/ (注意feed后的斜线。 if ($http_user_agent !~ "FeedValidator") { rewrite ^/feed$ http://example.com/feed redirect; }

Nginx在同一台服务器内redirect

如果我有一个服务器foo.com有一个根目录~/public_html/foo 。 由于某些原因,我想使用相同的服务器configuration,但指出从foo.com/test/的请求~/public_html/test 。 任何提示我怎么能做到这一点? rewrite ? location ?

有意将chown“root”设置为我的所有服务器

我在我的Web服务器上运行2个magento应用程序,并且偶然地从服务器的根目录设置了“chown -R www-data:www-data *”。 意思是,所有的文件都由用户root拥有。 这立即引起了magento网站上的问题,即:mysql没有连接,因为它应该使用“mysql”用户。 我自修,并将网页文件设置为由www-data拥有。 网站现在运行良好,但是当我尝试敲定一个订单时,它在那里暂停一分钟,然后超时。 订单注册在后台但它不显示“订单成功页”,因为它应该。 我正在运行nginx和php-fpm,而php-fpm日志是这样写的: [22-Mar-2013 13:31:24] WARNING: [pool www] child 1791, script '/var/www/website.com/index.php' (request: "POST /index.php") execution timed out (1436.378897 sec), terminating [22-Mar-2013 13:31:24] WARNING: [pool www] child 1791 exited on signal 15 (SIGTERM) after 1600.011818 seconds from start [22-Mar-2013 13:31:24] NOTICE: [pool www] child 2717 started 发生了什么? 这可能会发生,因为一些文件不属于他们的正确的所有者? […]