我在Digital Ocean上设置了一个Ubuntu服务器。我已经设置了Nginx + Unicorn来为我的Rails应用程序提供服务。但是,当我启动Unicorn和Nginx时,我只能在端口8080上访问我的rails应用程序。当你点击端口80上的地址时,它只是点击默认的Nginx页面。
服务器的网址为http://192.241.194.250/,配置文件位于https://gist.github.com/davidpatrick/7ee06429abe0c119e835。谁能告诉我我做错了什么?
由于
答案 0 :(得分:0)
如果您看到此类页面(我也是),则表示/
未与您的应用相关联。
抱歉,我现在无法检查和测试您的配置。不过我有一些建议:
location
有没有 /
条款,请尝试类似的内容:
location / {
## Serve static files from defined root folder.
## @unicorn is a named location for the upstream fallback, see below.
try_files $uri $uri/index.html $uri.html @unicorn;
}
行server_name localhost;
对于Internet中的服务器来说很奇怪。尝试在这里使用FQDN或IP。
这里有good example Nginx和Uncorn的完整功能和安全配置