0
因此,我部署了我的Rail 3應用程序,它具有相當標準的NGinx和Thin配置。但我堅持了三個問題 -無法在NGinx和Thin上訪問Rails應用程序而無需在URL中使用端口
- ,我只能通過端口附加到URL(domain.com:port)
- 是www.domain.com仍顯示nginx的歡迎屏幕上訪問應用程序和
- 在訪問URL中使用端口應用程序應該理想地不工作
我的Nginx的conf:
upstream thin_cluster {
<ip_address>:3000;
<ip_address>:3001;
<ip_address>:3002;
}
server {
listen 80;
server_name domain.com www.domain.com;
root /home/deployer/apps/appname/current/public;
location ^~ /assets/ {
gzip_static on;
gzip_disable "msie6";
expires max;
add_header Cache-Control public;
}
location/{
try_files $uri @thin;
}
location @thin {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://thin_cluster;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 50M;
keepalive_timeout 10;
}
My Thin conf:
---
chdir: /home/deployer/apps/appname/current
environment: production
address: 0.0.0.0
port: 3000
timeout: 30
log: log/thin.log
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 100
require: []
wait: 30
servers: 3
daemonize: true
onebyone: true
您需要防火牆本地端口或使用套接字連接方案。 –