7
Railscasts 에피소드 # 293에서 설명한대로 nginx 및 unicorn에서 실행되도록 설정했습니다. 내가 http://unicorn/posts
대신nginx 및 unicorn 설정에서 레일 리다이렉트가 실패합니다
http://mydomain.com/posts
의로 리디렉션 등
class PostsController < ApplicationController
def show
redirect_to posts_path, :notice => "Test redirect"
end
end
로
내가 리디렉션하려고
는 여기이 나를 위해 작동하는 응용 프로그램upstream unicorn {
server unix:/tmp/unicorn.scvrush.sock fail_timeout=0;
}
server {
listen 80 default deferred;
# server_name example.com;
root /var/apps/current/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;
}
keepalive_timeout 5;
}
내가 대신 내가 가진 위치 @의 unicorn''위치 /''의, 비슷한 설정을 가지고있다. 너 그거 해봤 니? – Frost
@MartinFrost 그래, 도움이되지 않았다. 그것이 나에게 그것은 도메인 이름 대신 기본 URL로 proxy_pass URL을 사용하는 것으로 보입니다. –
'./config/unicorn.rb' 콘텐츠도 게시 할 수 있습니까? 예 : 'listen' 지시어가있는 줄. – Tilo