Articles of nginx

NGINX + Redmine的乘客部署 – 403禁止

看过这个问题问了几次,尝试了几个张贴的解决scheme,没有任何运气。 安装了phusion乘客w / nginx,运行ruby 1.9.3下的多用户rvm安装 有点熟悉nginx和通过uwsgi部署Python应用程序 – 这一个让我难住 我的nginx vhostconfiguration粘贴在下面: server { listen 80; server_name EXAMPLE.COM; access_log /home/redmine/logs/nginx_access.log; error_log /home/redmine/logs/nginx_error.log; client_max_body_size 10m; keepalive_timeout 120; root /home/redmine/redmine-repo/public; passenger_enabled on; } 供参考的静态文件正确地被服务 例如当我尝试访问:http: //EXAMPLE.COM/images/duplicate.png 它显示得很好 – 我已经将整个/ home / redmine目录设置为chmod -R 0777 / home / redmine 思考我错过了configuration方面的东西 – 任何想法我失踪?

WordPress的网站响应速度极慢(仅针对第一个请求)

我的wordpress网站有一个奇怪的问题( http://rohitnair.info/ )。 “第一次请求”需要很长时间才能做出回应。 任何后续的响应行为正常。 我在debugging时看到的东西 清除浏览器caching并重新加载工作正常,页面加载速度不够快 清除cookie和重新加载重现问题。 nslookup等不需要时间(所以排除DNS查找问题) 问题似乎可以从其他机器/networking重现(所以排除本地机器/networking问题) mysql中没有什么缓慢的查询日志 因此,我在这个上下文中将“第一请求”定义为没有为该域设置cookie的请求。 另一个简单的方法来重现这个问题是使用curl,而不是发送任何cookie。 这是curl -v的输出 $ time curl -v rohitnair.info * About to connect() to rohitnair.info port 80 (#0) * Trying 23.21.171.95… connected * Connected to rohitnair.info (23.21.171.95) port 80 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.9.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > […]

麻烦configurationnginx和php

我一直无法获得一个PHP脚本与Nginx的工作。 调用脚本my-url:90 / useraccessauthorization / useraccessauthorization.php给我一个404错误。 以下是我的configuration细节。 有人能让我知道我失踪了吗? 提前致谢。 编辑 :我也应该提到,运行“/etc/init.d/nginx reload”给了我结果: 重新加载nginxconfiguration:nginx:[alert]无法打开错误日志文件:open()“/var/log/nginx/error.log”失败(13:权限被拒绝)2012/05/10 16:07:13 [warn ] 18214#0:只有主进程以超级用户权限运行时,“user”指令才有意义,在/etc/nginx/nginx.conf中将忽略:1 nginx:configuration文件/etc/nginx/nginx.conf语法是好的2012/05/10 16:07:13 [emerg] 18214#0:open()“/var/run/nginx.pid”失败(13:权限被拒绝)nginx:configuration文件/ etc / nginx / nginx。 conftesting失败 / etc / nginx / sites-available / default: server { listen 90; root /usr/share/nginx/www; index index.html index.htm; access_log /var/log/nginx/top-secret-project.access.log; server_name localhost; location / { try_files $uri $uri/ /index.html; […]

nginx重写锂电池框架的规则

我一直在试图让Nginx运行lithium没有成功。 lithium的目录结构就是这样 lithium |-> app libraries .htaccess |-> webroot .htacess –other directories |-> index.php .htaccess –other files 我将lithium文件夹复制到我的/var/www/ 。 锂的path是/var/www/lithium/ 现在我在我的nginx.conf这种方式设置重写规则 server { listen 80; server_name localhost; root /var/www/; location /lithium { rewrite ^/$ /app/webroot/ break; rewrite ^(.*)$ /app/webroot/$1 break; } location /lithium/app { rewrite ^/$ /webroot/ break; rewrite ^(.*)$ /webroot/$1 break; } location /lithium/app/webroot […]

未findNginx,Uwsgi和Django应用程序

我在CentOS上用uWSGI和Djangoconfiguration了Nginx。 Django目录(包含我所有的Django应用程序): / home Django项目目录: / home / hdblog /home/hdapp.py包含如下: import os, sys sys.path.append('/home') os.environ['DJANGO_SETTINGS_MODULE'] = 'hdblog.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() 我正在使用下面的命令: /etc/init.d/uwsgi –socket 127.0.0.1:8889 –master –workers 2 –harakiri 30 –disable-logging –daemonize /tmp/daemonize.log –pidfile /tmp/pidfile.txt –vacuum –gid 500 –uid 500 –pythonpath /home/hdblog –module hdapp 另外,我的/etc/nginx/conf.d/default.conf包含下面的行: location / { include uwsgi_params; uwsgi_pass 127.0.0.1:8889; } 正如你可以看到一切正常,但我看到80端口 […]

如何检查负载平衡器L7注入头

有一个硬件LB将httpredirect到Nginx的SSL Offloader,只在443处侦听。我没有访问LB,但是我需要validation它是否注入了X-Forwarded-For头。 为什么? 我正在尝试使用http { log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; 和server { access_log logs/access.log main; set_real_ip_from 10.10.10.10; #LB VirtualService IP real_ip_header X-Forwarded-For; 但它不是日志logging。 我在这里错过了什么? PD Nginx 1.0.14编译–with-http_realip_module

MySQL,PHP-FPM,APC,Varnish和Nginx优化WordPress / W3总caching?

我正在build立我的第一个VPS,它似乎运作良好。 在Ubuntu 12.04服务器上安装了Nginx,php-fpm(作为unix套接字),APC,Varnish和MySQL以及OnApp,并且一切正常,并且速度非常快,至less在我的最后。 Atm我有1个核心的VPS(Xeon(R)X5660是VPS使用的iirc),1.2GHz和768MB RAM,一切都受限于OnApp。 做一个abtesting,我得到这个: ab -c 10 -n 1000 http://198.136.50.39/ 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 198.136.50.39 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed […]

节点端口转发或代理通过Nginx?

在运行Ubuntu的EC2服务器实例上托pipe节点/快速应用程序的最佳方法是什么(就速度/最佳实践而言)? 使用Nginx作为这个问题中概述的代理。 在iptables中添加端口转发规则,例如https://gist.github.com/776580 。 任何人都可以概述任何方法的任何问题,使用Nginx似乎有点毫无意义,当我所做的是从端口80转发请求到8000。

Nginx SSL_do_handshake例程SSL3_CHECK_CLIENT_HELLO

我在我的错误日志中find了这个: 2012/05/29 14:01:02 [crit] 30038#0: *4186107 SSL_do_handshake() failed (SSL: error:14124145:SSL routines:SSL3_CHECK_CLIENT_HELLO:multiple sgc restarts) while SSL handshaking, client: 80.208.151.166, server: iridium 任何想法这是关于什么?

nginx代理到不同的path

我读过nginx的HttpProxyModule的文档,但我无法弄清楚这一点: 我想这样,如果有人访问,例如http://ss.example.com/1339850978将代理他们http://dl.dropbox.com/u/xxxxx/screenshots/1339850978.png 。 如果我只是在我的configuration文件中使用这一行: proxy_pass http://dl.dropbox.com/u/xxxxx/screenshots/; ,那么他们将不得不追加.png自己。