我在Ubuntu 13.04中安装了nginx 1.4.1 sudo add-apt-repository ppa:nginx/stable sudo apt-get install update sudo apt-get install nginx 当我运行nginx -V它会返回nginx version: nginx/1.4.1以及其他configuration细节,但是我没有看到任何spdy模块configuration。 那么我怎样才能configurationspdy模块后安装或我必须重新安装从源代码和传递自定义configuration?
我在1GB的单核VPS上运行Nginx 1.5.1和PHP-FPM(PHP 5.3.26)的Drupal 6,SSD存储上有3GB的交换空间。 我刚刚从共享主机切换到这个非托pipe的VPS,因为我的网站变得太重了,所以我仍然在学习绳索。 我有很高的stream量,我没有真正注意到,但谷歌Adsense通常每天接近3万页的浏览量。 我通常有50到80个经过身份validation的用户login,另外还有几百个匿名用户在任何特定时间点击Boost静态HTMLcaching。 我最多configuration了10个PHP-FPMsubprocess。 我正在使用“ondemand”PHP-FPM进程pipe理器。 我偶尔遇到一个很难debugging的错误,因为它看起来是随机的。 用户可能有30多个故意的post,其中1个被复制。 我configuration了它,所以后button被禁用后,第一次点击,所以这不是双击的结果。 实际上,当我发布的时候,它甚至发生在我身上。 双职位发生在几秒钟内。 我检查了日志文件,并且重复的post似乎总是对应于nginx的POST错误: recv() failed (104: Connection reset by peer) while reading response header from upstream 。 而这个事件似乎涉及index.php和PHP-FPM工作进程的后续SIGTERM执行超时错误的PHP-FPM错误。 以下是nginx访问和错误日志以及PHP-FPM错误日志: nginx_acess.log文件: 1.2.3.4 – – [02/Jul/2013:12:34:34 -0500] "POST /comment/reply/22802/420734?quote=1 HTTP/1.1" 302 5 "http://example.com/comment/reply/22802/420734?quote=1" "Mozilla/5.0 (X11; Linux i686; rv:21.0) Gecko/20100101 Firefox/21.0" 1.2.3.4 – – [02/Jul/2013:12:34:34 -0500] […]
我已经按照给定的官方说明安装了GitLab,但是在尝试使用它时收到了502错误。 Nginx日志条目: *30 upstream prematurely closed connection while reading response header from upstream, client: 95.27.118.xx, server: gitlab.somehost.net, request: "GET /users/sign_in HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/users/sign_in", host: "gitlab.somehost.net" 正如我从以前的GitLab安装经验中记得的那样,错误原因是GitLab在第一次用户访问时初始化,而nginx认为它是超时的,所以解决方法是增加一些超时值。 问题是我不记得哪个超时我应该增加(这解决了以前的安装我的错误),谷歌并没有帮助我。
我有一个干净的Centos 6.4(x64)最小版本安装(完全更新)。 一旦操作系统安装完成,我按照这个相对简单的指南设置我的FTP: http : //www.krizna.com/centos/how-to-configure-ftp-server-on-centos-6/ SELinux is disabled. anonymous_enable=NO (vsFTPD Config) chroot_local_user=YES (vsFTPD Config) 而不是根据/ ftp / [username](根据指南)创build一个linux本地用户,我select使用/ home / [username]的标准位置,其中[username]是服务器 (在我的设置中) 我testing了我的FTP服务器,并安装并正常运行。 所以我login到FTP并创build了一个名为“public_html”的文件夹,然后用<?php phpinfo(); ?>在其中创build了一个index.php文件<?php phpinfo(); ?> <?php phpinfo(); ?>代码在里面。 (所以完整path是:/home/server/public_html/index.php) 然后,我安装了nginx&php-fpm,并按顺序为每个configuration文件创build了下列configuration文件。 /etc/php-fpm.d/server.conf (我的本地nix acc:server的php-fpm池): [server] listen = '/var/run/php-fcgi-server.sock' listen.allowed_clients = 127.0.0.1 user = server group = server pm = static pm.max_children = […]
我们正在运行Nginx 0.7.65 [-1ubuntu2.3]。 我刚刚注意到,当使用alias指令和gzip on提供本地静态文件gzip on , Content-Length头不会被发送。 由于它是从本地文件系统提供文件,因此获取文件长度不会有任何问题。 我如何强制Nginx发送一个Content-Length头文件?
我试图设置django在某些郊区,让/myproject ,用nginx和uwsgi。 但是,我无法得到它的工作。 无论我尝试,似乎uwsgi_modifier1 30; 选项不起作用。 我总是得到加倍path,而不是localhost:8000/myproject ,我得到localhost:8000/myproject/myproject 我错过了什么? 这里是相关的文件: Django的urls.py from django.conf.urls import patterns, include, url from django.http import HttpResponse # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', lambda x: HttpResponse('Hello world'), name='home'), # Uncomment the next line to enable the […]
我试图build立一个nginxconfiguration如下:当收到像/tile/SteveCountryVic/1/2/3.png的请求: 尝试将其传递给http://localhost:5005/1/2/3.png 如果那404s,传递给另一台服务器作为/tile/SteveCountryVic/1/2/3.png 这是我的configuration,这是不是很工作: server { listen 80; server_name localhost; error_log /tmp/nginx.error.log notice; access_log /tmp/nginx.access.log; location /tile/SteveCountryVic/ { rewrite_log on; #rewrite ^.*/(\d+)/(\d+)/(\d+).*$ /$1/$2/$3.png break; proxy_intercept_errors on; error_page 404 = @dynamiccycletour; #proxy_set_header Host $http_host; #proxy_pass http://127.0.0.1:5005; proxy_redirect /tile/SteveCountryVic/ http://localhost:5005/; location @dynamiccycletour { rewrite_log on; #rewrite ^(\d+)/(\d+)/(\d+).*$ /tile/SteveCountryVic/$1/$2/$3.png break; proxy_pass http://115.xxx:20008; } location /tile/ { proxy_set_header Host […]
我计划使用单独的Nginx服务器作为软件负载平衡器来平衡我的应用服务器之间的负载。 但事实上,这是因为应用程序服务器前面的负载平衡器允许我在没有停机的情况下更新应用程序服务器(操作系统,应用程序等)。 然后我意识到,我该如何更新负载均衡器本身? 即当我需要更新作为我的应用程序负载平衡器的服务器上的操作系统和Nginx时,我的网站仍然会停下来。 由于硬负载平衡无可厚非,我想知道是否可以将两个Nginx Web服务器连接在一起,以便在应用程序服务器之间平衡负载,同时使我能够在需要时一次更新一个,而不会导致停机。 这是现实吗?
openssl req -new -x509 -days 8192 -newkey rsa:4096 -extensions v3_ca -config conf / caconfig.cnf -keyform PEM -keyout private /key.ca.pem -outform PEM -out certs / crt.ca.pem 我现在正在使用nginx与IPv6结合使用,现在没有任何问题,但是当尝试部署SSL时,失败, bind() to […]:443 failed (99: Cannot assign requested address) nginxconfiguration(无服务器名称等): # Works like a charm server { listen 80; listen [2a03:4000:2:3c8:6e65:6f6b:6572:80]:80; return 301 https://$host$request_uri; } # Cannot assign requested […]
我知道我的设置有点疯狂,但无论…. 我在Openshift上设置了Nginx来caching地图查看器(对于地图查看器,您可以猜测目的:-)),这些地图查看器是从我的家庭networking(具有有限的带宽(愚蠢的无线连接!))提供的。 Openshift给我无限的带宽和1 GB的磁盘,这应该足以caching地图的stream行部分。 但是,地图查看器喜欢这样的请求: http://localhost/tiles/world/t/-1_0/-27_23.png?1381358434308 这使得nginx认为这个文件是不可caching的! 我已经做了一些Googlesearch,但是因为我在阅读和编写正则expression式时非常可怕,所以我想请求(从你这里)让nginx忽略.png文件的查询string,并且只提供没有请求参数。 以下是服务器configuration的相关部分: http { proxy_cache_path ${OPENSHIFT_RUNTIME_DIR}/cachefile levels=1:2 keys_zone=my-cache:599m max_size=700m inactive=250m; proxy_temp_path ${OPENSHIFT_RUNTIME_DIR}/cachefile/tmp; include mime.types; default_type application/octet-stream; # Format for our log files log_format main '$remote_addr – $remote_user [$time_local] $status ' '"$request" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; sendfile on; keepalive_timeout 5; access_log ${OPENSHIFT_LOG_DIR}/access.log; port_in_redirect off; server_tokens off; tcp_nopush on; […]