我有一个使用子目录的网站,目前只有当结尾的斜杠被添加到URL(“ http://www.domain.com/dir/ ”)时才起作用。 当没有结尾斜线时,我得到“无法连接到服务器domain.com:8080”(8080是Nginx设置的监听端口)。 我尝试添加在这里 (和这里 )build议的重写,但它会导致整个虚拟主机的“无法连接”错误。 是否有另一种方法来添加我可以尝试的尾部斜杠? 或者,有没有一种方法可以将其configuration为将URL看作目录(从而查找索引文件),而不pipe是否存在尾部斜杠?
我有一点困难。 我写了一个自定义的PHP MVC框架,并在其上构build了一个CMS。 我决定给nginx + fpm一个旋转。 这是我困境的根源。 我被要求在我的网站上join一个wordpress博客(yah)。它有很多内容,在短时间内我不得不将所有的内容放到我的CMS中。 由于使用了Apache多年,我承认,使用nginx会有一点损失。 我的网站有文件path: /opt/directories/mysite/public/ wordpress文件位于: /opt/directories/mysite/news/ 我知道我只需要设置target / news [/ *]的位置,然后强制所有匹配的URI到index.php中。 有人可能指向我正确的方向吗? 我的configuration如下: server { listen 80; server_name staging.mysite.com index index.php; root /opt/directories/mysite/public; access_log /var/log/nginx/mysite/access.log; error_log /var/log/nginx/mysite/error.log; add_header X-NodeName directory01; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log […]
我刚刚完成了我自己的VPS的设置,其规格如下:2 Ghz单核CPU和1 GB RAM。 我正在使用nginx来满足我的web服务器需求。 我安装了Ruby on Rails,Phusion Passenger,mysql和php5-fpm。 我上传了一个WordPress博客,并且遇到了响应速度慢的问题: http : //cl.ly/6Hks 。 请求页面时,CPU负载约为10-20%。 当我看着ps aux,我看到下面的输出: root 896 0.0 0.3 40916 4080 ? Ss 10:49 0:00 /usr/bin/php5-fpm –fpm-config /etc/php5/fpm/php5-fpm.conf www-data 897 0.1 3.2 66488 33260 ? S 10:49 0:04 /usr/bin/php5-fpm –fpm-config /etc/php5/fpm/php5-fpm.conf www-data 898 0.1 2.0 54660 21084 ? S 10:49 0:04 /usr/bin/php5-fpm –fpm-config […]
我已经在Ubuntu上configuration了Nginx和Passenger下的Gitorious。 当我尝试添加ssh密钥时,我得到一个500服务器错误,其中gitorious告诉我负责人已被通知。 在服务器日志上,我们看到: TypeError (can't convert nil into Integer): vendor/plugins/paperclip/lib/paperclip/processor.rb:45:in `sprintf' vendor/plugins/paperclip/lib/paperclip/processor.rb:45:in `make_tmpname' /usr/local/rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/tmpdir.rb:132:in `create' /usr/local/rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/tempfile.rb:134:in `initialize' app/models/ssh_key.rb:121:in `new' app/models/ssh_key.rb:121:in `valid_key_using_ssh_keygen?' app/models/ssh_key.rb:47:in `validate' vendor/rails/activerecord/lib/active_record/validations.rb:1099:in `valid?' vendor/rails/activerecord/lib/active_record/callbacks.rb:315:in `valid_with_callbacks?' vendor/rails/activerecord/lib/active_record/validations.rb:1077:in `save_with_validation' vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_with_dirty' vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `block in with_transaction_returning_status' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction' vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction' vendor/rails/activerecord/lib/active_record/transactions.rb:228:in `with_transaction_returning_status' vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `block in save_with_transactions' vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!' vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save_with_transactions' app/controllers/keys_controller.rb:48:in `block in create' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:106:in `call' […]
我使用nginx来提供静态文件,并作为Erlang IM服务器的代理。 每个用户使用两个长轮询http连接。 操作系统是Ubuntu的服务器。 在繁忙时间,我看到: > sudo more /proc/sys/fs/file-nr 1024 0 38001 在正常的时间,文件描述符的数量低于1024,但从不超过1024.当我达到1024的限制时,用户报告连接丢失。 尽piperoot用户(erlang),www-data用户(nginx)和打开的TCP连接每个都低于1024,但为什么受限于1024个文件描述符? 有一些全球性的1024限制吗? 我是否需要在nginx中使用worker_rlimit_nofile,或者是否足够在所有用户的limits.conf中增加nofile? 谢谢 更多信息可能是相关的: > sudo nano /etc/security/limits.conf … root hard nofile 30000 root soft nofile 30000 > sudo sysctl fs.file-max fs.file-max = 38001 > ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority […]
我在我的NGINX error.log上发现了这个错误: 2011/05/09 23:33:52 [error] 22145#0: *1158 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xx.xx.xxx.xxx, server: *.mywebsite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "mywebsite.com" 这是什么意思? 可能是一个PHP的FPM问题?
我有一个使用Tornado构build的应用程序,运行在带有Nginx的前端服务器的两台16核心服务器上。 Tornado的部署指南提出了每个CPU固化程序的一个应用程序实例,因此我总共运行了32个应用程序实例。 我在Nginx上遇到的问题是,如果应用程序服务器出现问题导致所有实例不可用(导致连接超时),则NGINX会遍历32个实例中的每一个,并在返回错误之前检查它。 连接超时设置为5秒,所以在NGINX实际发送回用户说出现问题之前2:30分钟。 在向用户发送错误之前,有没有办法限制NGINX将重试的服务器数量? IE浏览器检查两台服务器,然后放弃而不是循环浏览所有的服务器?
我现在有两个域名。 两者都运行在Apache上,并在nginx之后(使用proxy_pass)。 一个网站是Django的,另一个是PHP和两个运行在不同的端口。 我想以类似的方式部署更多的域名,但是在不同的应用程序的多个端口上运行Apache是一个不好的做法? 如果是/否,为什么?
我试图为我的MVC框架设置URL重写,但因为这是我第一次使用Nginx,我有一点麻烦。 我的应用程序有两个接入点: /index.php /admin/index.php 我需要将这些文件夹/访问点的URL路由到相应的索引文件,例如: /admin/auth/login/ >>> /admin/index.php?/auth/login/ /contact/ >>> /index.php?/contact/ 这是我迄今为止: #Project server { listen 7000; listen localhost:7000; location / { root /srv/www/htdocs/ASDDL/; index index.php; } location /admin/ { root /srv/www/htdocs/ASDDL/admin/; index index.php; } location ~ \.php$ { fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/htdocs/ASDDL/$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } } 现在,你可以看到,我认为问题在于以下行: fastcgi_param SCRIPT_FILENAME /srv/www/htdocs/ASDDL/$fastcgi_script_name; 那里没有路由到pipe理文件夹,因为它试图路由到根index.php文件,任何人都可以阐明正确的方式来做到这一点?
我正在Ubuntu服务器上运行以下链接的网站:Web服务器 – Nginx + Apache(worker)+ mod_wsgi + django后台工作人员 – 芹菜,rabbitmq DBs – mysql,mongo 我正在寻找一个最好(和简单的部署)与Web界面的服务器监控工具。 我检查了其中的几个 – zabbix,monit和其他一些。 似乎所有这些都在PHP上,因此需要Apache处于prefork模式。 我发现没有nginx的安装提示,所以我的问题是:1)哪个工具可能是首选监视我的大部分环境2)请指出最简单的工具部署在nginx或apache-worker 谢谢