我如何将真正的访客IP地址转发给Unicorn? 目前的设置是: Haproxy => Nginx => Unicorn 我怎样才能将真正的IP地址从Haproxy转发到Nginx到Unicorn? 目前它总是只有127.0.0.1 我读了X头文件将被放弃。 http://tools.ietf.org/html/rfc6648 – 这将如何影响我们? Haproxyconfiguration: # haproxy config defaults log global mode http option httplog option dontlognull option httpclose retries 3 option redispatch maxconn 2000 contimeout 5000 clitimeout 50000 srvtimeout 50000 # Rails Backend backend deployer-production reqrep ^([^\ ]*)\ /api/(.*) \1\ /\2 balance roundrobin server deployer-production […]
我似乎无法让我的服务器加载环境variables。 在我理想的设置中,我希望1个用户(部署者)在单个服务器上提供多个应用程序。 Ubuntu 12.04,Nginx,Unicorn。 在我的应用程序中,我有一个包含应用程序所需的所有环境variables的.env文件。 这是我失败的尝试: 我用特殊的shell脚本启动独angular兽。 我不能在这里使用源代码,所以我不知道如何加载其中的环境variables。 #!/bin/sh ### BEGIN INIT INFO # Provides: unicorn # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Manage unicorn server # Description: Start, stop, restart unicorn server for a specific application. ### END INIT INFO […]
突然之间,我的应用程序停止工作,这些是我从最后的线路 unicorn.log unicorn worker[0] -D -c /home/deployer/apps/myapp/current/config/unicorn.rb -E production: relocation error: /lib/x86_64-linux-gnu/libssl.so.1.0.0: symbol CRYPTO_memcmp, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference E, [2013-02-28T18:32:49.240524 #23929] ERROR — : reaped #<Process::Status: pid 26634 exit 127> worker=0 I, [2013-02-28T18:32:49.240810 #23929] INFO — : worker=0 spawning… I, [2013-02-28T18:32:49.255824 #26647] INFO — : worker=0 spawned pid=26647 […]
我有Rails应用程序运行在独angular兽+ nginx上。 下面是nginx.conf和unicorn.rbconfiguration。 nginx.conf upstream unicorn { server unix:/tmp/unicorn.todo.sock fail_timeout=0; } server{ listen 80 default deferred; #server_name localhost; root /var/www/demo/public; try_files $uri/index.html $uri @unicorn; location @unicorn { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://unicorn; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; } unicorn.rb working_directory "/var/www/demo" pid "/var/www/demo/tmp/pids/unicorn.pid" stderr_path […]
gitlab看起来应该是好的,但它不是 – 页总是返回: 502 Whoops, GitLab is taking too much time to respond. 状态: $ gitlab-ctl status run: gitlab-workhorse: (pid 10244) 718s; run: log: (pid 6421) 2922s run: logrotate: (pid 10252) 717s; run: log: (pid 6541) 2920s run: nginx: (pid 10258) 717s; run: log: (pid 6422) 2922s run: postgresql: (pid 10270) 716s; run: log: (pid […]
我试图configuration两个应用程序由nginx提供。 第一个似乎工作正常,我重复了第二个configuration,但我有一些问题。 我正在使用套接字运行由Unicorn支持的Sinatra服务器来传递上游信息。 我可以到达根域(api.richardson.co.nz),一切似乎工作正常,但只要我尝试访问根域(api.richardson.co.nz/games)path得到一个“找不到”的错误。 这是我的nginx conf文件: worker_processes 1; user nginx web; pid /tmp/nginx.pid; error_log /var/www/knowyourgenre.com/shared/log/nginx.error.log; events { worker_connections 1024; # increase if you have lots of clients accept_mutex off; # "on" if nginx worker_processes > 1 use epoll; # enable for Linux 2.6+ } http { include mime.types; default_type application/octet-stream; access_log /tmp/nginx.access.log combined; sendfile on; […]
我得到当前安装了两个应用程序的服务器,我需要添加另一个,这里是我的configuration。 nginx.conf user www-data www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Disable unknown domains ## server { listen 80 default; server_name _; […]
我在轨道上有一个应用程序,它在生产中运行独angular兽。 有一些请求需要花费很长时间来处理。 我已经configuration服务器来增加超时,所以这些请求正常工作。 问题是,当请求需要超过30秒的响应时,我得到这个消息: 暂停服务 该服务暂时不可用。 请稍后再试。 在unicorn.rb我有timeout 120configuration和我的nginx.conf是: upstream unicorn_my_app { server unix:/tmp/my_app.socket fail_timeout=0; } server { listen 80; client_max_body_size 4G; server_name www.my_app.com; proxy_read_timeout 120; keepalive_timeout 5; root /home/ubuntu/my_app/current/public; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://unicorn_my_app; break; } } error_page 404 500 502 503 […]
发送大容量date到我的服务器时,我的POST请求上得到414(请求 – URI太大)exception。 是否有可能增加POST数据的限制? 我已经做了nginxconfiguration下面的变化 large_client_header_buffers 8 2024k; 但它不起作用。
我正在按照这个教程安装Apache +独angular兽,但似乎Apache不提供任何静态文件。 这里是我想出的configuration(看看Redirect all non-static requests to unicorn特别是): <VirtualHost *:80> ServerName www.unstilted.com:80 ServerAlias *.unstilted.com DocumentRoot /var/www/unstilted/current/public ErrorDocument 503 /system/maintenance.html RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{REQUEST_FILENAME} !/system/maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Rewrite to check for Rails non-html cached pages (ie xml, json, atom, etc) RewriteCond %{THE_REQUEST} ^(GET|HEAD) RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI} -f RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [QSA,L] […]