免责声明:我已经阅读了大量的post在这里,在stackoverflow和其他网页,我不能拿出一个解决scheme,所以希望这会有所帮助。 我们使用nginx和HAProxy在Passenger上运行Rails应用程序。 乘客:4.0.7 Nginx:1.4.1 该应用程序运行良好,但时常,请求花费太长的时间完成: #nginx access.log xxxx – – [19 / Mar / 2015:01:07:19 +0100]“GET / HTTP / 1.0”499 0“ – ”“runscope-radar / 2.0” 请求花费很长时间才能完成,nginx返回一个499,HAProxy将其转换为504.大约30分钟后,服务器恢复正常,但错误不断重现。 我很确定它与HAProxy没有任何关系,因为卷到机器上的本地主机也会返回超时。 服务器上没有什么特别的东西(根据htop,4核心的CPU使用率从来没有超过10%,从8GB到大约只有1GB,loadavg一直在0.1以下)。 我将ulimit设置为65535。 nginx的configuration文件是: user www-data www-data; worker_processes 1; worker_rlimit_nofile 20000; events { worker_connections 768; } http { passenger_root /opt/passenger/passenger-4.0.7; passenger_ruby /usr/bin/ruby1.8; include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush […]
我们使用的是Nginx 1.6.2 + Passenger 5.0.6,并且有一个用PHP-FPM定义的虚拟主机,它提供了一个MODx安装。 只有一个位置/ sinatraapp使用Ruby 2.1.1服务Sinatra应用程序。 设置如下,工作相当好,但我们遇到了一个奇怪的问题。 在向Referer发送请求时,nginx响应403 Forbidden,而Sinatra App / Passenger发回302(302redirect在这种情况下是正确的响应!)。 在没有引用者的情况下执行请求时,它按预期工作。 不起作用: curl -H "Referer: https://www.example.org" https://example.com/sinatraapp 工作: curl -H "Referer: -" https://example.com/sinatraapp 而将Referer-Header完全离开也是可行的。 Sinatra应用程序将302用户到一个MODx subsite example.com/de/something。 Nginxconfiguration: server { listen [::]:443 ssl spdy ipv6only=on; listen 443 ssl spdy; server_name www.example.com; charset utf-8; ssl_certificate /etc/ssl/certs/example_com.crt; ssl_certificate_key /etc/ssl/private/example_com.key; ssl_trusted_certificate /etc/ssl/certs/example_com_bundle.crt; ssl_session_cache shared:SSL:10m; […]
我有一个rails应用程序通过capistrano在aws ec2实例上部署,并且在服务器上也安装了nginx客户端。 每当我尝试使用提供的DNS或公共IP访问我的应用程序时,我所得到的只是浏览器加载了一段时间而没有响应,甚至没有从nginx的错误页面。 这里是我的nginxconfiguration(/ etc / nginx / sites-enabled / default) server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name <public ip>; passenger_enabled on; rails_env production; root /home/ubuntu/myapp/current/public; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } 在运行命令“sudo nginx”时,这是我得到的回应: […]
我目前正在使用Phusion Passenger + Nginx在服务器上运行一个简单的Meteor.js应用程序。 我想要做的就是对其进行configuration,以便在www.example.com上有一个主要应用程序,以及www.example.com等上的其他应用程序。 我怎样才能使用上述工具来实现这种configuration? 我知道如何做到这一点只使用nginx,但它似乎需要额外的乘客configuration。 我目前的nginxconfiguration如下: server { listen 80; server_name example.com; # Tell Nginx and Passenger where your app's 'public' directory is root /var/www/app1/bundle/public; passenger_friendly_error_pages on; # Turn on Passenger passenger_enabled on; # Tell Passenger that your app is a Meteor app passenger_app_type node; passenger_startup_file main.js; # Tell your app where MongoDB […]
一个域名系统(DNS)的问题:(也被问到堆栈溢出 ) 我有一个amazon web services(AWS)Elastic Beanstalk(EB)站点,可能有数千个子站点。 显然,在AWS上使用Alogging是不可能的,因为它们可以实现服务器平衡,并且可以移动IP地址。 到目前为止,我已经设置了一个CNAMElogging: www CNAME http://mysite.elastic-beanstalk.com. 和networking转发,以处理对“裸”域的请求。 @ / http://mysite.elastic-beanstalk.com 我现在需要将子域名映射到正确的位置: url typed and seen by the user >> currently live and working page subdomain1245.mysite.com >> http://subdomain1245.mysite.elastic-beanstalk.com : www.subdomain1245.mysite.com >> http://subdomain1245.mysite.elastic-beanstalk.com … X1000 我能find的最接近的教程提到了“通配符”DNS匹配,如: * CNAME http://mysite.elastic-beanstalk.com. 我尝试了后者,从testing中我可以看出,它只是将所有子域redirect到主域。 我需要子域保持显示在url中,并redirect到子域名页面。 如果有人能够展示并且理想地解释一个策略,那么这将是非常有帮助的! ******* UPDATE ********* 新的线索: 使用* CNAME http://mysite.elastic-beanstalk.com. ,访问subdomain1245.subdomain1245.mysite.com提供正确的页面(subdomain1245.mysite.elastic-beanstalk.com)。 我们find了另一个可能的select:删除* CNAME […]
我试图在Ubuntu机器上使用apache运行redmine + gitolite服务器。 我按照以下服务器configuration文件中的说明进行操作: <VirtualHost *:80> ServerName redmine.xyz.com ServerAdmin someone@somewhere DocumentRoot /var/www/ PassengerUserSwitching on RewriteEngine On RewriteRule ^/?$ /redmine [R] <Directory /var/www/redmine> RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on PassengerUser redmine PassengerGroup redmine </Directory> LogLevel info ErrorLog ${APACHE_LOG_DIR}/error-redmine.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 现在,当我访问网站时,以下内容将被logging在默认的error.log文件中: [ 2015-11-07 12:44:45.7366 1568/7f9da7df9780 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1562/generation-0/request [ 2015-11-07 12:44:45.7422 1574/7faddd156780 […]
我想知道如何设置umask的nginx或乘客或两个进程。 search似乎只会带来Apache。 任何帮助将非常感激! (这在Debian上)
我正在服务一个Rails应用程序在一个sub-uri像https://projects.mydomain.com/app1/ 但我的资产没有加载。 这里是我的nginxconfiguration: location ~ ^/app1(/.*|$) { root /srv/www/app1/current/public; passenger_base_uri /app1; passenger_app_root /srv/www/app1/current; passenger_document_root /srv/www/app1/current/public; passenger_enabled on; } location ~ ^/(assets)/ { root /srv/www/app1/current/public; gzip_static on; expires max; add_header Cache-Control public; } 该应用程序已加载,所有URL / PATH前缀为/ app1 /,但资源未加载。 https://projects.mydomain.com/app1/assets/application-123456.css不起作用 当我尝试没有前缀的资产path时,我可以看到资产存在: https://projects.mydomain.com/assets/application-123456.css工作 任何想法 ? 更新: 增加了error_log /var/log/nginx/error.logdebugging; 当然这是一个编辑的摘录: 2015/12/18 11:15:44 [debug] 27187#0: *1 http process request line […]
我尝试安装Rails + Passenger + Nginx + Modules,但安装程序开始编译Nginx时出现错误: sh ./configure –prefix='/opt/nginx' –with-http_ssl_module –with-http_gzip_static_module –with-http_stub_status_module –with-cc-opt=-Wno-error –with-ld-opt='' –with-pcre='/tmp/passenger.1x6s546/pcre-8.34' –add-module='/usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.24/src/nginx_module' –with-http_geoip_module –with-http_limit_conn_module –http_limit_req_module –with-http_log_module 而乘客安装后,它开始与Nginx它会引发错误: error: ./configure: error: invalid option "–with-http_limit_conn_module" 什么可能是一个原因?
我的问题:让我的Ruby on Rails应用程序使用SSL在JustHost共享服务器上运行。 各个部分分别在共享服务器上工作: 我已经build立了我的应用程序,通过cpanel中主机的Phusion Passengerconfiguration工作。 我已经尝试过,没有“生产”标志打勾。 我可以通过http /端口80运行我的应用程序。它一切正常。 我可以访问https /端口443上的安全连接。但是,当我这样做,我只是得到一个目录列表。 我可以在config / production.rb中强制使用config.force_ssl = true的ssl连接,但是我只是被强制转到目录列表。 我的.htaccess文件如下所示: <IfModule mod_passenger.c> Options -MultiViews PassengerResolveSymlinksInDocumentRoot on #Set this to whatever environment you'll be running in RailsEnv production # following line changes to development or production RackBaseURI /home2/mysite/production/myapp SetEnv GEM_HOME /home2/mysite/ruby/gems PassengerEnabled on </IfModule> 我的文件设置是这样的: ~/public_html/ site –> ~/production/myapp/public […]