我想让我的应用程序的v1在一个池中,在另一个池中的v1.1版本中,然后慢慢增加stream量,使其减less到一个池。 任何人都可以用HA Proxy,Varnish,Nginx或其他的东西来展示一些具体的例子吗?
我使用nginx作为反向代理来pipe理部署在Tomcat服务器上的应用程序。 我需要一些帮助来确定线程池/连接池的大小/ …我find了很多描述不同参数的文档(Tomcat执行者,nginx工作者,keepalive,…),但是没有太多文档解释如何find正确的尺寸。 我不确定我是否正确理解文档。 例如,我在我的nginx监控图中看到,我有大约350个活动连接,30个写入连接和320个等待连接。 我每秒约有30个请求。 我在Tomcat服务器上configuration了200个线程来处理HTTP处理。 我有1个工作进程nginx与1024个工人连接。 从我所了解的文档中,等待的连接是HTTP1.1保持连接。 但是我也明白,nginx只是将HTTP1.0作为代理。 我有点困惑。 这些等待连接的消耗Tomcat线程什么都不做? 你知道一个关于调整Tomcat / nginx(或另一个反向代理,概念应该是相同的)的好资源。 谢谢你的帮助!
我已经尝试了很多东西,但不能够使错误日志工作,但访问日志工作正常。 这里提到的解决scheme不适合我: http://mailman.nginx.org/pipermail/nginx/2009-February/009567.html (试图把错误作为error_log婴儿车 – 没有运气) http://forum.nginx.org/read.php?2,58447,58447 (停止nginx后不要过时) 这里是虚拟主机信息: server { server_name .qa.domain.ca; root /var/www/qa.domain.ca; access_log /var/log/nginx/qa.domain.ca/access.log; error_log /var/log/nginx/qa.domain.ca/error.log; index index.html index.htm index.php; # redirect to non-www if ($host ~* ^www\.(.*)){ set $host_without_www $1; rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent; } if (-d $request_filename){ rewrite ^/(.*[^/])$ /$1/ permanent; } location / { # First attempt to serve […]
(编辑:部分理解和解决,见评论) 我有一个设置与Nginx作为一个CherryPy应用服务器前面的反向代理。 我使用ab来比较通过nginx和不通过的性能,并且注意到前一种情况的最坏情况性能要差得多: $ ab -n 200 -c 10 'http://localhost/noop' This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient) Completed 100 requests Completed 200 requests Finished 200 requests Server Software: nginx Server Hostname: localhost Server Port: 80 […]
我正在用C语言编写一个社交网站,并用Nginx来提供。 我该如何做到这一点,以便通过身份validation的用户可以访问他们自己的目录 – 只有用户特定的index.html所在的目录。 我不是问如何用特定于用户的指令填充index.html,而是如何将它们locking到自己的目录中
我的开发人员只允许将一些文件下载到局域网用户。 我说好吧,这很简单,我写了像这样的nginxconfiguration的变化: location /restricteddir/download/file { allow 192.168.0.0/16; allow 10.0.0.0/8; deny all; } 好,从外面我得到403这样好,但从内部(LAN)给我404。为什么? 我已经检查过,磁盘上不存在文件的位置。 开发人员告诉我,这个位置是由phpdynamic生成的,所以文件在tmp目录中,但是当你点击如下链接之后: https://example.com/report/download/file/id/somefile.txt它应该开始下载,但它给404错误。 最后一个物理位置是/restricteddir/download所以file/id/somefile.txt是由php生成的。 为了testing,我将位置更改为/restricteddir/download ,之后https://example.com/restricteddir/download给了我404。 禁用限制后,我很困惑,所有目录工作正常,我可以从https://example.com/report/download/file/id/somefile.txt下载文件,然后按https://example.com/report/download/无404.那么错误在哪里? 我应该添加到我的nginxconfiguration,使其工作? EDIT1这是这个虚拟主机的完整configuration: #example.com:443 server { listen 443 default; ssl on; ssl_certificate example.crt; ssl_certificate_key example.key; ssl_session_timeout 15m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; server_name example.com; access_log /var/log/nginx/example.com.access.log; error_log /var/log/nginx/example.com.error.log; location / { root /sites/public; […]
当我重新启动我的服务器(而不是nginx,整个服务器),Nginx无法自动启动。 login服务器后,我可以手动启动nginx(服务nginx启动)。 有用。 但是,如果我再次重新启动,我必须手动启动Nginx。 在检查Nginx的error.log时,我看到这个错误重复了几次: 2012/08/27 09:19:23 [emerg] 1066#0: bind() to [ipv6]:80 failed (99: Cannot assign requested address) 我怎样才能解决这个问题? 这是什么问题? (我正在运行Ubuntu 12.04服务器)
我用Nginx设置了一个服务器,并设置了我的Public_HTML – /home/user/public_html/website.com/public 它总是redirect到 – /usr/local/nginx/html/ 我怎样才能改变这个? Nginx.conf – user www-data www-data; worker_processes 4; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay off; keepalive_timeout 5; gzip on; gzip_comp_level 2; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; include /usr/local/nginx/sites-enabled/*; } / usr / local / […]
我在这里对Nginx有一点新意,所以请耐心等待 – 我想重写一个url,如foo.bar.com/newfoo?limit=30到foo.bar.com/newfoo.php?limit=30 。 看起来很简单,像这样rewrite ^([az]+)(.*)$ $1.php$2 last; 我感到困惑的部分是放在哪里 – 我尝试过一些位置指令,但是我做错了。 这里是我现有的虚拟主机configuration,我应该在哪里实现我的重写? server { listen 80; listen [::]:80; server_name foo.bar.com; root /home/foo; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.html; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; deny all; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; […]
我已经在nginx中用ssl_crl指令设置了CRL文件: ssl_crl /mypath/crl.pem 但是,我注意到,添加或删除从crl.pem撤销的证书只适用于我重新启动或重新加载nginx服务器。 这个最好的做法是什么? 当crl.pem改变或重新加载nginxconfiguration?