我正在尝试使用Go and the Revel framework在我的live-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
在这里完全失去了.我是否需要在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
解决方法:
我可以回答我自己的问题.我最终将我的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;
}
}
}
Go Revel personalwebsiteapp app.conf
http.addr="127.0.0.1"
http.port=9000
在此之后,启动Nginx,运行你的狂欢应用程序和中提琴!,http://my-personal-website.com现在正在运行.
标签:revel,go,nginx,http,port 来源: https://codeday.me/bug/20190725/1532932.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。