我在nginx日志中得到了下面的错误 客户端:[cut],server:[cut],request:“GET / venues HTTP / 1.1”时,recv()失败(104:由对等方重置连接)[error] 17734#0:* 6643 ,上游:“fastcgi://127.0.0.1:9000”,主机:“[cut]” 我有一个8 GB的RAM,四核芯片专用的盒子。 好的服务器。 Nginx,php-fpm&mysql所有最新版本在ubuntu 10.04下运行 当我用压力testing服务器时,我只能得到这个。 如果我把并发连接的数量增加到100,我可以得到20%的所有请求失败。 此外,我没有得到这个没有MySQL查询的网页上。 只有less量的查询失败。 位,我不确定那是否要做任何事情。 我有一种感觉,这是用php做的事情。 但我无法弄清楚。 任何build议甚至从哪里开始寻找? 更新:和PHP错误日志是沉默的。 没有任何logging发生错误
我刚刚在新服务器上安装了nginx 1.2.5版本,发现我无法更改默认网站的默认文件。 在/ etc / nginx / sites-available / default文件中,我有以下几行: server { listen 80 default_server; server_name myserver; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; root /var/www/default; error_page 404 /4044.html; location / { index index.html index.htm; } } server { … server2… } server { … server3… } 不幸的是,当我通过使用服务器的IP地址http://ip_address打开一个页面,而不是文件/var/www/default/index.html nginx显示它的默认文件“Welcome to nginx”。 在出现404错误的情况下,它不显示文件/var/www/default/4044.html,但它是默认的“找不到”页面。 我试图改变:listen 80 default_server; 听80默认; 和server_name myserver; […]
我正在使用Nginx并创build一个像这样的小型configuration文件: server { listen 80; server_name domain.com; root /var/www/script; location /something { root /var/www/another_script/; rewrite /something/(.*)$ /index.php?var=$1; } } 这个问题出现在重写规则中,而不是/var/www/another_script 我可以重写到位置的新根吗? 或者这是不可能的? 提前致谢 。 ps:有人可能会build议使用alias而不是root ,但这不是真正的问题。
我有Django的应用程序(基于夹层)。 我的nginx conf看起来像: upstream myhost { server 127.0.0.1:8000; } server { listen 80; server_name www.myhost.ru myhost.ru; client_max_body_size 10M; keepalive_timeout 15; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Protocol $scheme; proxy_pass http://myhost; } location /static/ { root /home/myhost/virtualenvs/myhost/project; access_log off; log_not_found off; } location /robots.txt { root /home/myhost/virtualenvs/myhost/project/static; […]
我已经看了大约5个问题和博客文章,并尝试了所有他们告诉我没有运气。 我可以浏览www.example.com/phpinfo.php,而不是www.example.com/index.php。 我什至甚至使phpinfo.php符号链接的index.php和phpinfo.php仍然工作,而index.php不。 Nginxconfiguration [admin@web01 www]$ cat /etc/nginx/conf.d/example.com.conf server { listen 80; server_name www.example.com; # Document root index index.php; root /var/www/sites/example.com/www; # Pass PHP scripts to FastCGI server location ~* \.php$ { include fastcgi.conf; try_files $uri =404; fastcgi_pass 127.0.0.1:9000; } } [admin@web01 www]$ cat /etc/nginx/fastcgi.conf fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method;fastcgi_param CONTENT_TYPE […]
我们最近安装了WT-NMP,并且正在运行php 5.4.24的Php-Cgi。 我们正在运行相当简单的PHP脚本,当testing一切运行良好。 在这个周末我们想让服务器在更长的时间内运行testing。 服务器和脚本周五整天都运行良好,但周六晚些时候,php-cgi停止运行。 错误日志(C:\ WT-NMP \ log)中没有错误。 在configuration(php.ini)我有以下选项设置:error_reporting = E_ALL display_errors =在display_startup_errors =在log_errors =在html_errors =在error_log =“c:/wt-nmp/log/php_error.log” 我们也有标准的nginx.conf错误日志:access_log“c:/wt-nmp/log/nginx_access.log”; error_log“c:/wt-nmp/log/nginx_error.log”警告; 所以,由于日志目录是空的,我假设正在运行的php脚本和一般的nginx操作不会导致php-cgi停止。 所以我的问题是:还有什么可能导致php-cgi停止运行? 有没有其他的日志logging选项,我们可以打开,可以帮助我们跟踪这个呢? 还有其他的日志位置,我们应该看看? 谢谢!
我负责redirect和拆分请求的nginx服务器。 在我们的生产引擎中运行nginx 1.2.1,并在testing机器上运行1.4.1。 configuration是一样的,但在生产环境中,我总是得到一个500 Internal Server Error"但在testing环境中运行正常,我总是检查access.log和Nginx的error.log,但没有什么可担心的。 我怎样才能分析错误,并进一步调查这个错误的原因?
我想知道如何为每个文件提供不同的内容types。 例如,我有以下nginxconfiguration: server { listen 80; server_name site.com; location ~ ^/(.*) { root /home/site/; try_files $uri $uri.png $uri.bin =404; } } 因此,例如任何$uri.png都会有image/png内容types头,而$uri.bin会有application/octet-stream 。 问题:我不知道如何确定哪个try_filesselect了file 。 我有lua模块build立和工作,以防万一需要。 有没有其他人试过这样的事情?
我成功地在NginX上部署了我的wordpress网站。 我需要永久链接http://www.example.com/%postname%和博客http://blog.example.com/%postname% 。 它将所有wwwstream量redirect到非www,但是当我尝试通过取消注释下面所写的NginX的mydomainconfiguration文件中的行来将非wwwredirect到www时,浏览器会抱怨redirect循环。 我的全球/ restrictions.conf是: http://pastebin.com/cLfMv6jC 而global / wordpress.conf是: http://pastebin.com/Uc9KSqhh 和NginX的服务器块的mydomainconfiguration文件是: server { server_name _; return 301 $scheme://www.example.com$request_uri; } #server { # listen 80; # server_name example.com; # return 301 $scheme://www.example.com$request_uri; #} server { listen 80 default_server; listen [::]:80; root /usr/share/nginx/html/example.com; index index.php index.html index.htm; server_name www.example.com; include global/restrictions.conf; include global/wordpress.conf; } 请指出我的错误。 [更新]事实上,我也有以下服务器块: […]
最近我一直有一些问题与PHP-FPM,我注意到,IO是非常高的所有PHP-FMI(99.9%),这是什么导致CPU负荷秒杀。 顶部命令 top – 06:28:53 up 8 days, 21:05, 2 users, load average: 179.61, 82.23, 70.63 Tasks: 913 total, 11 running, 901 sleeping, 0 stopped, 1 zombie Cpu(s): 9.7%us, 1.7%sy, 0.0%ni, 31.4%id, 56.0%wa, 0.0%hi, 1.1%si, 0.0%st Mem: 16296824k total, 9676012k used, 6620812k free, 242004k buffers Swap: 8159228k total, 16k used, 8159212k free, 6596628k cached PID […]