2
我與aws混淆,並且想要將多個應用程序部署到我的免費層aws帳戶。Nginx,獨角獸和子軌道中的多軌應用程序
我想有nginx的點「ec-2-site.com/first-app」和「ec-2-site.com/second-app。
這裏是我當前的配置文件(基本上是猜測,並從this railscast
upstream unicorn_chaos {
server unix:/tmp/unicorn.chaos.sock fail_timeout=0;
}
upstream unicorn_blog {
server unix:/tmp/unicorn.blog.sock fail_timeout=0;
}
server {
listen 80 default deferred;
location /chaos/ {
#server_name http://ec2-50-16-81-170.compute-1.amazonaws.com/chaos;
root /home/deployer/apps/chaos/current/public;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control 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_chaos;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
location /blog/ {
# server_name example.com;
root /home/deployer/apps/blog/current/public;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control 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)blog;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
}
這裏檢查是我得到的錯誤:
nginx: [emerg] named location "@unicorn_chaos" can be on the server level only in /etc/nginx/sites-enabled/chaos:23
顯然,這@unicorn_appname指令不應該存在,但這裏應該是我要去回合所有這一切G?
感謝
一個天真的問題,但是上面給出的'http {}'塊內的整個代碼? – Kashyap 2013-05-11 04:23:30
你是如何解決這個問題的? – 2013-07-09 09:04:29
我沒有解決它。這是一個個人aws服務器,從那以後我一直沒有做過這方面的工作。 – Squadrons 2013-07-09 14:56:34