我设置了nginx来代理请求到一个Web服务器池。 我希望nginx通过等待转发请求来限制并发请求到每个Web服务器的数量,以便Web服务器不会被压倒。 有没有办法在nginx中做到这一点?
我正在运行一个Django应用程序w / Nginx和Apache。 我们所有的静态媒体都存储在S3上,基本上应用程序需要花一些时间来检查每次加载页面时是否创build了缩略图。 为了缓解这个问题,我caching了模板w / memcached的输出。 在一两个小时的时间里,网站的速度明显下降,直到我重新启动apache,然后一切都变好了。 我有很less的系统pipe理经验,希望有人能够把我指向正确的方向。
当我准备testing一些变化时,我想我会设置一个维护页面块,以便我可以进行testing。 刚刚意识到,nginx的维护块示例使网站为每个人。 你如何维护网页的访问者仍然会允许本地主机访问。 我应该只是创build一个新的服务器块监听另一个端口,并拒绝所有,允许127.0.0.1?
我构build了我的网站,如: /home/www/domain.com/public,private, log, backup 在日志文件夹中,我创build了一个空白的error.log和access.log。 站点中的我的nginx文件可用于该域,如下所示: server { access_log /home/www/domain1.com/log/access.log; error_log /home/www/domain1.com/log/error.log; } 试图启动nginx它说: starting nginx: the config file /etc/nginx/nginx/conf syntax is ok [emrg] open() "…/access.log" failed (2: no such file or directory) 这是一个权限问题?
我需要设置nginx,以便在发生超时尝试到达上游代理时,它只会将caching的版本返回到磁盘上。 有人能告诉我怎么做,因为文件信息有点稀疏。
所以我有一个nginx服务器,通过与Sinatra的https工作。 当我尝试在configuration中下载一个jnlp文件,该configuration在Mongrel和http(no s)上正常工作时,nginx服务器无法为该文件提供504错误。 随后检查日志指出,这个错误是由于溢出了可用的文件句柄数量,即“24:太多的打开的文件”。 运行 sudo lsof -p <nginx worker pid> 给我一个巨大的文件列表,全部看起来像: nginx 1771 nobody 11u IPv4 10867997 0t0 TCP localhost:44704->localhost:https (ESTABLISHED) nginx 1771 nobody 12u IPv4 10868113 0t0 TCP localhost:https->localhost:44704 (ESTABLISHED) nginx 1771 nobody 13u IPv4 10868114 0t0 TCP localhost:44705->localhost:https (ESTABLISHED) nginx 1771 nobody 14u IPv4 10868191 0t0 TCP localhost:https->localhost:44705 (ESTABLISHED) nginx 1771 nobody […]
我可以configurationApache反向代理服务器,以便它从本地文档根加载一些文件? 像可能是静态文件? 我可以用Nginx作为Apache的替代(mod_proxy,mod_proxy_html,mod_rewrite)吗? 如果是的话,任何链接? build议?
假设请求点击我的Web应用程序是这样的: _http://mywebapp/empty.gif DATA1 = ABC&DATA2 = 123 通过使用Nginx的empty_gif模块,我正在做类似于: location /empty.gif {expires -1; post_action / empty_gif_post; empty_gif; } location = / empty_gif_post {internal; proxy_pass http://mywebapp/_track.php ; } 这种方法的问题是,它不会让我检索GET参数。 任何解决这个问题?
我想使用NginxHttpMapModule和NginxRedirect将静态链接redirect到dynamicPHP链接。 我想通过查看地图表中的url将http://my_domain/static/static_page1.htmlredirect到http://domain_name/dynamic/zone.php?zoneid = 86 。 我试过,但它在一个redirect循环结束。 map_hash_bucket_size 256; map $uri $dynamic_url { default 42; /static/static_page1.html 86; /static/static_page2.html 36; } server { listen 80; server_name domain_name; rewrite ^ http://domain_name/dynamic/zone.php?zoneid=$dynamic_url break; } 请帮我解决一下这个。 问候,Shain
我正在运行一个小的VPS(512MB-Ubuntu 10.04),我试图让Nginx坐在前面,并提供所有的图像/静态的东西,只有在需要时发送PHP请求到Apache2。 我想知道是否需要为Nginx中的每个站点设置一个虚拟主机,然后在Apache中也是一样,还是有更好的方法呢? 我一直在与它斗争,似乎过于复杂。 干杯,斯科特