我的主机说我使用的资源太多,我不知道是什么原因造成的。 它运行Ubuntu 10.04 LTS 32位。 它有2GB的RAM和2GB的SWAP。 我运行nginx作为安装了php-fpm&APC的networking服务器。 我运行的网站是wordpress与W3总caching插件。 我每天接待大约4k +的访客。 最佳: top – 17:18:35 up 2:23, 1 user, load average: 5.41, 6.36, 5.23 Tasks: 44 total, 1 running, 43 sleeping, 0 stopped, 0 zombie Cpu(s): 61.5%us, 5.6%sy, 0.0%ni, 31.5%id, 1.4%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 2097152k total, 352652k used, 1744500k free, 0k buffers Swap: 2097152k total, […]
我使用高可用性存储设置运行Gluster-FS 。 客户端和服务器节点都运行NginX来提供相同的文件。 main.mysite.com mirror1.mysite.com ..etc.. 问题是镜像节点不能提供文件,因为所有者和组是不同的。 主服务器上的所有者/组是: web1:client0 为了使镜像节点能够为文件服务,它们的所有者/组应该是: www-data:www-data 但是由于它们是从主服务器复制的,所有者/组属性与web1:client0相同 有什么解决scheme?
我正在使用nginx和spawnf-cgi与APC和memcache enabled.I'm 502浏览器坏门的方式和错误日志上的这个错误。 2013/01/07 06:55:46 [error] 90799#0: *53 upstream prematurely closed connection while reading response header from upstream, client: abcd, server: www.mysite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/fcgi.sock:", host: "www.mysite.com"
我正尝试通过使用X-Accel-Redirect nginx和rails来提供静态内容。 我的实际静态内容directort位于rails根文件夹,就像这个rails_root\books 。 这是我的nginxconfiguration文件映射URL与实际的文件位置 server { listen 3000; server_name 127.0.0.1; passenger_enabled on; root /home/voodoo/work/reader/public; location ~ /read/*./.* { internal; alias /home/voodoo/work/reader/books/sources/$1/$2; } location / { proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; passenger_pass_header X-Accel-Redirect; passenger_set_cgi_param HTTP_X_ACCEL_MAPPING /read/=/home/voodoo/work/reader/books/sources/; proxy_pass http://127.0.0.1:3001/; } } 和一个相应的轨道控制器 class ReaderController < ApplicationController def resource send_file "#{Rails.root}/books/sources/"+ […]
当我尝试访问Debian VPS上的nginx Web服务器上的PHP页面时,我一直收到一个空白页面。 nginx工作正常; 我可以访问任何正常的HTML页面。 PHP-FPM至less运行,因为我可以启动/重新启动它,当我停止它的PHP页面给我一个502错误的网关错误,这是正常的。 但是每当FPM运行时,任何PHP页面都是空白的,没有任何错误。 这导致我相信在FPM中有一个configuration错误。 这是我的php-fpm.conf: http ://pastebin.com/CSUuSzxx
问题 我已经configurationlogwatch(CentOS 5.8,x64)来包含nginx, 以此作为指导,并在日志格式上使用Apache和nginx文档。 问题是,我正在使用特定的日志格式,是: log_format main '$remote_addr – $remote_user [$time_local] "$request" $scheme:$server_port ' '$status $body_bytes_sent "$http_referer" ' 'Upstream ["$upstream_addr" ($upstream_response_time) $upstream_status : $upstream_cache_status] ' '"$http_user_agent" "$http_x_forwarded_for"'; (来自/etc/nginx/nginx.conf ) 我已经将这个日志格式翻译成: $LogFormat "%h %l %u %t \"%r\" %H:%p %>s %b \"%{Referer}i\" Upstream [\"%{Upstream-address}e\" (%{Upstream-response-time}e) %{Upstream-status}e : %{Upstream-cache-status}e] \"%{User-Agent}i\" \"%{X-Forwarded-For}e\"" 为Logwatch。 在研究/usr/share/logwatch/scripts/services/http ,我发现任何未被预定义的%{…}e将被忽略,所以我认为这将是包含这些上游variables。 但是,考虑到nginx,Logwatch不会给出任何输出。 我做了什么 我创build了以下logwatch文件: /usr/share/logwatch/default.conf/logfiles/nginx.conf […]
我在服务器上有很多的Vhost,我正在寻找一种方法来轻松地configurationUrl重写,而无需打开Putty,在SSH上连接和使用vim进行编辑。 是否有可能把重写规则放在我的www文件夹中的文件中,并每隔5-10分钟重新加载Nginx conf? 我不想要类似htaccess的行为。 只是把所有的rewrinting规则在我的项目的文件夹(SVN)。 在此先感谢(对不起,我的英语)!
我只是把一个中等繁忙的wordpress网站从共享主机移动到一个512MB内存的VPS服务器,并试图性能调整之前,我分手,并购买另一个VPS来减轻负载。 因此,我正在为nginx寻找性能提示,并碰到了“gzip”和“expires max”。 从我看到的一些例子和修补,我做了以下的改变,他们似乎工作正常,但YSlow不同的说法。 # Entry in nginx vhost.conf location /wp-content { alias /home/src/web/app/melikedev/current/code/web/wp-content/; expires max; add_header Pragma public; add_header Cache-Control "public"; } 并通过curl从另一台服务器进行testing: mpurcell@service1 ~ $ -> curl -I -H "Accept-Encoding: gzip, deflate" -L http://melikedev.com/wp-content/plugins/sociable/css/sociable.css?ver=3.4.2 HTTP/1.1 200 OK Server: nginx/1.0.15 Date: Fri, 18 Jan 2013 04:58:34 GMT Content-Type: text/css Last-Modified: Sat, 29 Dec 2012 […]
考虑下面的Nginxconfiguration文件(64位Linux上的Nginx版本1.2.6): location / { root html/www.domain.com; } location /image/ { root html/static.domain.com; } 使用这个configuration, html/www.domain.com/index.html提取html/www.domain.com/index.html ; /secure/profile.html从html/www.domain.com/secure/profile.html中选取,而/image/logo.jpeg则从html/static.domain.com/image/logo.jpeg 。 但是,对以下内容的请求会导致错误(可以理解): /index.html;affiliate=msn /image/logo.jpef~partner=msnbc 什么应该是正确的Nginxconfiguration忽略URL部分,如;affiliate=msn和~partner=msnbc ?
所以我决定玩nginx,我设法正确运行htm和php文件(php-fpm),但是有一个问题:它不显示favicon,也不显示在其他目录中的根目录。 nginx.conf: user nginx; worker_processes 2; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; pid /var/run/nginx.pid; events { worker_connections 512; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server […]