我在我的Ubuntu 10.10开发机器上安装了nginx 0.8.54,使用php fastcgi进行设置和工作。 我想开始做一些Rails的开发,所以我试图安装Passenger到我现有的nginx安装。 现在一切似乎都混在一起了。 我/网站,可用/默认configuration似乎没有工作,我不能浏览我以前设置的开发网站。 当我在terminal运行nginx -v它说0.8.54,但是当我浏览说http:// localhost / xyz它返回一个404和404错误页面指示0.8.53。 另外,如果我运行service nginx restart我得到以下内容: 重新启动nginx:[emerg]:bind()为0.0.0.0:80失败(98:地址已经在使用)[emerg]:bind()为0.0.0.0:80失败(98:地址已经在使用)[emerg] :bind()到0.0.0.0:80失败(98:地址已经在使用)[emerg]:bind()到0.0.0.0:80失败(98:地址已经在使用)[emerg]:bind()到0.0 .0.0:80失败(98:地址已经在使用)[emerg]:仍然无法绑定()nginx。 好像我有两个版本的nginx运行。 那可能吗? 我怎样才能解决这个问题,所以我有1个版本的PHP FastCgi和Rails / Passenger运行?
我有一个简单的Django应用程序,用于testing使用Nginx,FastCGI(在撰写本文时使用最新版本的flup)和daemontools的新部署策略。 基本上问题是如果我访问domain.com的主页面显示正确,但如果我访问domain.com/example/它仍然显示主页面。 这似乎是FastCGI对我来说的一个问题,但我完全难住了。 无论我访问的是哪个页面,都会显示主页面。 没有错误,没有什么。 它像它总是只是默默地返回相同的网页,不pipe什么url。 nginx的错误日志完全没有任何显示,所以这没有帮助。 该项目使用开发服务器100%完美工作,但只是在服务器上失败。 我的守护进程运行文件如下: #!/usr/bin/env bash source /envs/domain.com/bin/activate PROJ_DIR=/project exec envuidgid simon python $PROJ_DIR/manage.py \ runfcgi method=threaded minspare=1 maxspare=2 host=127.0.0.1 \ port=9001 pidfile=$PROJ_DIR/proj.pid daemonize=false 我的nginxconfiguration: server { listen 80; server_name domain.com; rewrite ^/(.*) http://www.domain.com/$1 permanent; } server { listen 80; server_name www.domain.com; access_log /domain.com/logs/access.log; error_log /domain.com/logs/error.log; root /domain.com/public_html; index index.html; […]
我试图将一些东西切换到运行nginx的域。 有没有简单的方法只是把我的IP地址在子域的configuration,并说:“如果IP不是我的,那么只是提供这个HTML文件,否则,像正常行为?
我正在扩大一个前端代理服务器,直到昨天我使用Squid作为反向代理(即使基本上没有被caching,即Squid只是代理)。 今天,我试着改变nginx,我注意到,我正在更快地打ip_conntrack限制。 作为一个短期的解决方法,我只是提高ip_conntrack限制(按照http://rackerhacker.com/2008/01/24/ip_conntrack-table-full-dropping-packet ),但我想知道这里有人知道为什么nginx是如此快速地触及这些限制,如果能做些什么来纠正它呢? (即更快地从跟踪表中popup连接)。 使用的东西是最新的Centos 5.5盒子,nginx 0.8.53和Squid 2.6。 一切都从RPM(核心或EPEL的)安装。 预先感谢您的任何build议或启发性讨论。 对于我自己的参考,这个其他线程在这个话题上很有用: 确定nginx反向代理负载限制
我遇到这个问题,当我启动nginx时,它开始以每秒1个GET请求的速率从端口80上的nginx发送/接收stream量到/ping ,但我无法追查是什么导致它。 任何想法如何追踪什么过程造成这种stream量? 日志示例: /tmp/nginx.error.log 2011/03/31 21:30:33 [error] 6587#0: *7213 connect() to unix:/home/deploy/apps/dashboard/current/tmp/sockets/unicorn.sock failed (111: Connection refused) while connecting to upstream, client: 10.252.27.111, server: myhost.com, request: "GET /ping HTTP/1.1", upstream: "http://unix:/home/deploy/apps/dashboard/current/tmp/sockets/unicorn.sock:/ping", host: "newcaprica11" 2011/03/31 21:30:33 [error] 6587#0: *7215 connect() to unix:/home/deploy/apps/dashboard/current/tmp/sockets/unicorn.sock failed (111: Connection refused) while connecting to upstream, client: 10.204.203.236, server: myhost.com, request: "GET […]
我有一个www.domain.com的SSL证书。 很显然,如果有人去https://domain.com,他们会从浏览器中得到关于证书不匹配的错误。 是否可以设置Web服务器将请求从https:// domain.comredirect到https:// www.domain.com? 在nginx中,我一直在尝试这个变体,但没有用: server { listen 443; server_name www.domain.com domain.com; if ($host !~ www.domain.com) { rewrite ^/(.*) https://www.domain.com/$1 permanent; } } 编辑:只是澄清,如果任何人通过普通的http点击网站,这不是一个问题,我已经可以redirect到https:// www.domain.com,这是正确的。 只有他们手动键入https:// domain.com,我不知道如何做redirect。
我需要帮助将一些Apache .htaccess规则转换为nginx规则。 希望有更多经验的人能帮助我。 这是我的规则: 1 RewriteEngine on RewriteCond %{HTTP_HOST} ^www.url.ba [NC] RewriteRule ^(.*)$ http://url.ba/$1 [R=301,L] RewriteRule ^api\.php /index.php?c=api&m=index&%{QUERY_STRING} [L] RewriteRule ^contact\.php /index.php?c=contact&m=index&%{QUERY_STRING} [L] RewriteRule ^([a-zA-Z0-9]{4,25})$ /index.php?c=api&m=check&hash=$1 [L] RewriteCond $1 !^(index\.php|images|css|script|ZeroClipboard\.swf) RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+) / [R=301,L] 2 RewriteEngine on RewriteCond %{HTTP_HOST} ^www.img.ba.ba$ [NC] RewriteRule ^(.*)$ http://img.ba/$1 [R=301,L] RewriteCond $1 !(\/protected)$ […]
只是想知道是否有可能让nginx,apc,memcached和varnish一起运行。 我目前运行在一个Dreamhost的私人虚拟服务器上,并不重要。 任何投入将不胜感激。
我有几个HTTP服务运行在同一台机器上,在不同的端口上。 我想使用nginx作为反向代理,但我似乎无法让我的设置非常正确。 我想要以下内容: /fossil/ ==> http://127.0.0.1:8080/fossil/index.php /fossil/(whatever) ==> http://127.0.0.1:8080/(whatever) /fossil/(whatever) http://127.0.0.1:8080/(whatever) /webmin/ ==> http://127.0.0.1:10000/ 一些更具体的位置由nginx自己服务 和其他一切由Apache ==> http://127.0.0.1:8001处理 这是头两个似乎造成麻烦, 我希望/fossil/下的所有东西都能在8080号港口化石处理。 除了根本身,必须由一个特殊的PHP页面(在Apache下)来处理。 怎么走这里?
我试图从一台服务器转移到另一台。 我通常使用apache,但是这个项目使用nginx和Ultimate SEO进行URL修改。 我正在使用相同的nginxconfiguration文件,但我结束了一个redirect循环错误。 以下是site-available中默认文件的内容: # You may add here your # server { # … # } # statements for each of your virtual hosts server { listen 80 default; server_name mysitehere.com; access_log /var/log/nginx/mysitehere.access.log; #fastcgi_param DOCUMENT_ROOT /site/public_html/; location / { root /site/public_html/; index index.php index.html index.htm; # rewrite ^/(.*) http://mysitehere.com/$1 permanent; #rewrite ^/index.php?main_page=shopping_cart$ http://mysitehere.com/index.php?main_page=shopping_cart […]