duanji6997 2013-10-01 04:12
浏览 43
已采纳

具有非本地活动站点的Go Revel框架

I'm trying to use Go and the Revel framework to run a simple app on my live, personal-website.com.

Everything is ok when I develop locally and test localhost:8888. However after installing on my web server and running my app from root, # run revel personalwebsiteapp I get the following error:

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

At a total loss here. Do I need to run a proxy server like Nginx or something on top of Revel?

Here's what could be a relevant part of my conf/app.conf file:

http.addr="personal-website.com"
http.port=80 #whether I set this to 80 or 8888 doesn't matter, I get the same error
  • 写回答

2条回答 默认 最新

  • doujiao6507 2013-10-03 13:47
    关注

    I can answer my own question. I ended up routing my Revel app to Nginx b/c I could never get @Intermernet's suggestion of using sudo revel run to work.

    Below are the key details from the nginx.conf and Revel app.conf files to make this work.

    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;
                    }
            }
    
    }
    

    Go Revel personalwebsiteapp app.conf

    http.addr="127.0.0.1"
    http.port=9000
    

    After this, just start up Nginx, run your revel app and viola!, http://my-personal-website.com is now live.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料