我在Nginx上得到这个错误信息ws: Error.log: 2012/07/23 21:20:33 [alert] 368#3636:* 2045 1024连接上游时,worker_connections不够,client:127.0.0.1,server:localhost,request:“GET / index。 PHP HTTP / 1.0“,上游:” http://127.0.0.1:80/index.php “,主机:”127.0.0.1“ 页面输出:您正在查找的页面暂时不可用。 请稍后再试。 操作系统:WinXp(SP3) configuration: worker_processes 1; error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr – $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" […]
首先我通过apt-get安装nginx和uwsgi。 而且,我将这行添加到nginx conf文件(/etc/nginx/conf.d/default.conf)中,如下面的行; server { listen 80; server_name <replace with your hostname>; #Replace paths for real deployments… access_log /tmp/access.log; error_log /tmp/error.log; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:8889; } } 我有一个错误; Starting nginx: [emerg]: open() "/etc/nginx/uwsgi_params" failed (2: No such file or directory) in /etc/nginx/conf.d/default.conf:11 configuration file /etc/nginx/nginx.conf test failed 如果我从uwsgi的源代码中添加uwsgi_params文件;我有一个简单的错误。 谢谢
警告:到目前为止,我只学习了如何使用nginx为自己的域和服务器块提供应用程序。 但我认为是时候深入一点。 为了减轻对多个SSL证书或昂贵的通配符证书的需求,我想从一个nginx server_name提供多个应用程序(例如rails应用程序,php应用程序,node.js应用程序)。 例如rooturl / railsapp rooturl / nodejsapp rooturl / phpshop rooturl / phpblog 我不确定理想的策略。 我已经看到和想到的一些例子: 多个位置规则,这似乎导致各个应用程序configuration要求之间的冲突,例如不同的重写和访问要求 通过后端内部端口隔离应用程序,这可能吗? 每个端口路由到自己的configuration? 所以configuration是孤立的,可以定制到应用程序的要求。 反向代理,我对这是如何工作的小无知,这是我需要研究? 这实际上是2以上? 在线帮助似乎总是代理到另一台服务器,如Apache 什么是有效的方法来隔离从一个单一的域通过子uris服务的应用程序的configuration要求?
我有一个由nginx服务的每分钟约6万个请求的网站。 最近,我启用了open file cache并看到了性能的显着改善。 但是在最初的时候,当负载是最大的时候,响应时间还是相当长的,nginx使用了很多的IO。 这是我目前的设置: open_file_cache max=10000 inactive=30s; open_file_cache_valid 60s; open_file_cache_min_uses 2; open_file_cache_errors on; 我还剩下一些记忆: free -m total used free shared buffers cached Mem: 7910 6917 992 0 439 885 -/+ buffers/cache: 5592 2317 Swap: 8099 0 8099 问题:现在是否为open_file_cache max=10000和其他参数select正确的值? 10000够了,是小还是大? 有没有办法监视打开文件caching使用?
您好,我有一个在ELB(负载平衡器)后面的EC2中的web服务器(运行nginx),终止SSL连接。 如果有一个请求www.domain.com它将http到ELB并传递到Nginx服务器上的http 如果有一个请求secure.domain.com它应该去https到ELB并传递到http到nginx服务器。 如果请求来自http://secure.domain.com我希望nginx做一个301redirect到https://secure.domain.com 。 我可以通过使用由ELB注入的http_X_Forwarded_Proto头来完成这个任务。 所以像 server { listen 80; server_name secure.domain.com ; if ($http_X_Forwarded_Proto = http) { return 301 https://secure.domain.com$request_uri; } …. } 问题是,“if()”似乎在服务器块上运行,因此,对于http://www.domain.com/foo (在另一个服务器块中)的请求被if()和301到https://secure.domain.com/foo 。 我怎样才能configurationnginx只是redirectsecure.domains.com到https而不影响我所有的其他虚拟主机? 谢谢
我已经安装了ngix + php5-fpm。 我很高兴,但我不能优化php5-fpm,使其工作没有错误。 每个固定的错误都会产生不同的错误 首先我得到了导致很多错误的默认设置: [04-Jun-2012 03:30:06] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it 我增加了所有数字: pm.max_children = 15 pm.start_servers = 5 pm.min_spare_servers = 3 pm.max_spare_servers = 5 ;pm.max_requests = 500 它造成了一个不同的错误: [28-Feb-2013 07:45:06] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there […]
我正在尝试将一个子目录redirect到一个PHP文件。 它不是提供文件,而是下载它,这意味着它不会读取它作为一个PHP文件。 更确切的说,它不会进入fastcgi location ~ \.php$指令。 一些有趣的事实: 一切工作完美的admin团队,但不是login块。 当我将location ~ \.php$指令移动到login之上时,我将^~ /login改成~ /login ,这对于重写规则rewrite ^/login/(.+\.php)$ /$1 last; /(。+ rewrite ^/login/(.+\.php)$ /$1 last; 。 我没有阅读关于该主题的Wiki Nginx文档,所以我知道nginx读取位置指令的优先级,但是并不告诉我如何处理这种情况! 我也读过 类似的问题https://stackoverflow.com/questions/10126117/need-help-understanding-configuring-an-nginx-location-directive (未答复) https://stackoverflow.com/questions/11961323/howto-setup-window-nginx-virtual-directory-with-php-support ,我试图实现没有成功 https://stackoverflow.com/questions/1011101/nginx-location-directive-doesnt-seem-to-be-working-am-i-missing-something涵盖了一个真正的(不是虚拟的)子文件夹的情况。 这是configuration: server { listen 80; server_name tyba-one.com *.tyba-one.com; root /var/www/tyba/public_html; rewrite_log on; error_page 404 /404.php; client_max_body_size 4M; if ($host ~* ^www\.(.*)){ set $host_without_www $1; […]
我正在运行一个数据库支持的网站,收到很less的stream量。 然而,一天或两天,请求将会超时,我会在Nginx的error.log看到这个(或类似的)错误: 2013/06/13 18:32:40 [error] 16723#0: *27796 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 199.71.215.214, server: app.mypythonwebapp.com, request: "POST /api?submit_staker_response HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/app.mypythonwebapp.com-uwsgi.sock", host: "app.mypythonwebapp.com", referrer: "https://app.mypythonwebapp.com/survey/5/791/70ea73eb9a489f2dead804a95c400ab2" 我正在运行uWSGI,在它的日志文件中没有任何与此相关的东西(我可以告诉)。 我怀疑它可能是PostgreSQL相关的,但如果我通过pg_stat_activity检查它的状态,我什么都看不到。 这是我的uWSGI YAMLconfiguration文件: uwsgi: socket: /var/run/uwsgi/%n-uwsgi.sock workers: 5 buffer-size: 32768 callable: app wsgi-file: /opt/sites/app.mypythonwebapp.com/run.py virtualenv: /opt/virtualenv/app.mypythonwebapp.com pythonpath: /opt/sites/app.mypythonwebapp.com 我所在的服务器有两个(虚拟化的)核心,所以我做了1 +核心* […]
我已阅读规范的答案在我的网站文件/文件夹应该在Linuxnetworking服务器上有什么权限? 不过,我仍然坚持。 我的设置是: 拥有构成网站的目录和文件的开发者用户“ade” 服务器是nginx与php-fpm通过套接字: fastcgi_pass unix:/tmp/php5-fpm.sock; 网站包含一个上传目录,在此configuration下运行时,必须由PHP写入 显然,我不想将权限设置为777 我创build了一个webadmin组,并添加了'ade'和nginx: $ groups ade ade : ade webadmin $ groups nginx nginx : nginx webadmin 我已经把站点中的所有者设置为我和webadmin组: chown ade:webadmin * …如你看到的: drwxrwxr-x 2 ade webadmin 4096 Jul 3 13:58 logs drwxrwxr-x 5 ade webadmin 4096 Jul 4 08:35 public drwxrwxr-x 4 ade webadmin 4096 Jul 3 16:18 […]
当在Nginx上运行培根(43字节透明像素)负载testing时,我们尝试了几个keepalive_requests值(从10到100,000),最佳值似乎是10 。 以下是这个小回复的服务器HTTP标头: HTTP/1.1 200 OK Server: nginx/1.5.6 Date: Wed, 23 Oct 2013 12:39:45 GMT Content-Type: image/gif Content-Length: 43 Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT Connection: keep-alive Nginx的keepalive_requests 100000比keepalive_requests 10慢两倍。 你能帮助理解这个结果吗? 或者告诉我们做错了什么? 作为参考,这里是nginx.conf文件 。