使用非本地主机,实时站点去Revel框架

tim*_*son 3 port http nginx go revel

我正在尝试使用Go和Revel框架在我的live,social-website.com上运行一个简单的应用程序.

我在本地开发并测试localhost:8888时一切正常.但是,在我的Web服务器上安装并从root运行我的应用程序后,# run revel personalwebsiteapp我收到以下错误:

ERROR 2013/10/01 04:01:35 harness.go:167: Failed to start reverse proxy: listen tcp xx.xxx.xx.xx:80: cannot assign requested address
Run Code Online (Sandbox Code Playgroud)

在这里完全失去了.我是否需要在Revel之上运行像Nginx这样的代理服务器?

这可能是我的conf/app.conf文件的相关部分:

http.addr="personal-website.com"
http.port=80 #whether I set this to 80 or 8888 doesn't matter, I get the same error
Run Code Online (Sandbox Code Playgroud)

tim*_*son 7

我可以回答我自己的问题.我最终将我的Revel应用程序路由到Nginx b/c我永远无法得到@Intermernet建议使用sudo revel run工作.

以下是nginx.conf和Revel app.conf文件中的关键细节,以使其工作.

nginx.conf

server {
        listen 80;
#       listen [::]:80 default_server ipv6only=on;

        root /usr/share/nginx/html; # not relevant, but gives error if root isn't set to something
        index index.html index.htm; # not relevant

        # Make site accessible from http://localhost/
#       server_name localhost;

        server_name my-personal-website.com;

                location / {
                        proxy_pass      http://127.0.0.1:9000;
                }
        }

}
Run Code Online (Sandbox Code Playgroud)

Go Revel personalwebsiteapp app.conf

http.addr="127.0.0.1"
http.port=9000
Run Code Online (Sandbox Code Playgroud)

在此之后,只需启动Nginx,运行你的狂欢应用程序和中提琴!,http://my-personal-website.com现已上线.