worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream
unicorn_server {
server
unix:/home/ec2-user/rails/WebApp/tmp/sockets/unicorn.sock
fail_timeout=0;
}
server {
listen 80;
server_name localhost;
location ~ ^/assets/(.*) {
alias /home/ec2-user/rails/WebApp/public/assets/$1;
}
location / {
root
/usr/share/nginx/html;
index index.html
index.htm;
try_files
$uri/index.html $uri.html $uri
@unicorn_rails_app;
}
location @unicorn_rails_app {
if (-f $request_filename) {
break; }
proxy_set_header
X-Real-IP $remote_addr;
proxy_set_header
X-Forwarded-Server $http_host;
proxy_set_header
X-Forwarded-Host $http_host;
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for;
proxy_set_header Host
$http_host;
proxy_redirect off;
proxy_pass
http://unicorn_server;
}
}
}
Really Good blog post.provided a helpful information.I hope that you will post more updates like this Ruby on Rails Online Course
返信削除