我有一个专门的服务器运行Debian 6,Nginx的1.07,PHP 5.3与PHP的FPM和percona的MySQL 5.1。 我只是最近设置了服务器,只有一个站点在上面运行。 我遇到的问题是,即使我有10个PHP的fastcgi进程设置,但1个PHP5-CGI进程消耗100%的CPU,而其他9消耗几乎0%。 目前,整个服务器速度很慢,站点也是如此。
如果我将nginx工作进程限制为1并允许500个连接,如果超出此限制会发生什么情况? 服务器是否返回503服务不可用? 基本上,我试图确保我的系统对抗DoS,不要期望每秒有超过500个同时连接。
我习惯把它们放在/ var / www或者/ home / www中,当使用apache的时候,将一个symlynk放到/ var / www中。 不知道为什么,但我读到这是一个安全问题。 那也是nginx网站的地方吗?
我有一个项目,我不得不将所有找不到的文件redirect到index.php。 我在apache中把.htaccess文件放在我的项目文件夹中。 该文件的内容是 – RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] 现在我想在nginx中一样。 这里是我的nginx.conf的样子 root /usr/local/apache2/htdocs; index index.php index.html index.htm; location /project/ { root /usr/local/apache2/htdocs; index index.php index.html index.htm; try_files $uri $uri/ index.php; } 现在,每当我提出一个像http://localhost/project/hello这样的请求,那么这个请求应该去http://localhost/project/index.php但是这个说File not found 。 现在为什么我认为这将工作是因为位置块内的root指令覆盖块外的root指令(尽pipe值相同),重写模块将查找/usr/local/apache2/htdocs/project/index.php 。 我在这里错过了什么? UPDATE 这个configuration工作 root /usr/local/apache2/htdocs; location /project/ { index index.php index.html index.htm; #effectively […]
我刚刚在已经有apache2工作的Linux Mint系统上安装了nginx。 然而,nginx接pipe所有的请求到本地主机和所有我的虚拟域,并显示nginx的默认页面响应每个url。 我以为它只是接pipe了apache2正在使用的端口80。 无论如何,我试图find一种方法来使nginx使用端口:8080而不是:80,但所有的信息,我发现与使用nginx作为某种forms的前端apache2,因此nginx使用:80和apache2使用:8080代替。 在我的情况下,我只是希望他们互相独立运行,这样我就可以在apache2和nginx上独立地testing对方的东西。 我怎样才能让nginx使用端口:8080而不是:80?
我刚刚设置了nginx作为一个反向代理,所以一些从站点服务的站点直接服务于它,而另外一些则转发到Node.js服务器。 但是,由Node.js服务的站点没有显示CSS或图像,所以我假设链接被破坏,但不知道为什么。 以下是/ etc / nginx / sites-enabled中的唯一文件: server { listen 80; ## listen for ipv4 listen [::]:80 default ipv6only=on; ## listen for ipv6 server_name dev.my.site; access_log /var/log/nginx/localhost.access.log; location / { root /var/www; index index.html index.htm; } location /myNodeSite { proxy_pass http://127.0.0.1:8080/; proxy_redirect off; proxy_set_header Host $host; } } 我曾经想过,也许是因为第一次进入而试图在/ var / www中find它们,但是删除它似乎没有帮助。
我想请求http://example.com/foobar返回http://example.com/foobar.jpg 。 (或.gif,.html,.whatever) 这对Apache MultiView来说是微不足道的,在Nginx中看起来也是一样的。 这个问题似乎意味着它会很容易,因为try_files $uri $uri/ index.php; 在位置块,但这是行不通的。 try_files $uri $uri/ =404; 不起作用,也不try_files $uri =404; 或者try_files $uri.* =404; 在我的location / {块和匹配图像的正则expression式之间移动它没有任何影响。 至关重要的是, try_files $uri.jpg =404; 可以工作,但只适用于.jpg文件,如果在位置块中使用多个try_files规则,则会引发configuration错误! 当前server { block: server { listen 80; server_name example.org www.example.org; access_log /var/log/nginx/vhosts.access.log; root /srv/www/vhosts/example; location / { root /srv/www/vhosts/example; } location ~* \.(?:ico|css|js|gif|jpe?g|es|png)$ { expires max; add_header […]
我在Debian上使用nginx,并configuration了一个服务器 server { listen 172.30.0.172 deferred; } 当我testingnginxconfiguration我仍然得到 [emerg] bind() to 172.30.0.172:443 failed (99: Cannot assign requested address) 这是一个SSL主机,并使用起搏器为HA,因此,我需要能够推迟绑定
目前nginx使用我所有的带宽。 我如何离开一些rsync?
我已经有一个非常默认的网站启用设置在我的nginx在debian挤压,我现在试图让它服务我myhost / munin / inheritance人我已经添加到configuration的位置 location /munin { root /var/cache/munin/www/; index index.htm index.html; } 这里是我收到的错误: 2012/07/09 23:52:03 [error] 3598#0: *13 "/var/cache/munin/www/munin/index.htm" is not found (2: No such file or directory), client: 93.*.*.*, server: , request: "GET /munin/ HTTP/1.1", host: "" 这个设置习惯于在Apache中“正常工作”。 我是nginx的新手,所以在寻找path时为什么要添加额外的/ munin有点失落。 有什么build议?