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条)

报告相同问题?

悬赏问题

  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误