即时通讯试图启动一个Nginx服务器上heroku自由环境。 我准备好了任何的方法和教程,但我没有得到它运行。
首先,我想在端口80上启动Nginx作为默认web服务器。之后,我想configurationNginx作为下划线express服务器(其他heroku实例)的代理。 4天,我试图启动我的heroku实例上只有Nginx。 我总是得到不允许在端口80上启动的exception。我从( https://github.com/benmurden/Nginx-pagespeed )分叉了Nginx-buildback( https://github.com/moohkooh/Nginx-buildpack ) -buildpack )来调整一些configuration。 如果我运行Nginx通过端口2555上的英雄bash,Nginx开始,但我得到连接拒绝在networking浏览器。
State changed from starting to crashed
我的Dyno的procfile
没有检测到procfile,使用默认的Web服务器(webrick)
Heroku的麻烦 – 卸载/重新安装heroku toolbelt Ubuntu的
pip freeze> requirements.txt – 权限被sudo拒绝? (heroku-烧瓶教程)
在linux上安装iodocs
来自领class的“No Processes Defined”检查一个简单的node.js procfile
web: bin/start-Nginx
daemon off; #Heroku dynos have at least 4 cores. worker_processes <%= ENV['Nginx_WORKERS'] || 4 %>; events { use epoll; accept_mutex on; worker_connections 1024; } http { gzip on; gzip_comp_level 2; gzip_min_length 512; server_tokens off; log_format l2met 'measure#Nginx.service=$request_time request_id=$http_x_request_id'; access_log logs/Nginx/access.log l2met; error_log logs/Nginx/error.log; include mime.types; default_type application/octet-stream; sendfile on; server { listen <%= ENV['PORT'] %>; server_name _; keepalive_timeout 5; root /app/www; index index.html; location / { autoindex on; } } }
我也将PORtvariables设置为80
heroku config:get PORT 80
其他一些configuration:
heroku config:get Nginx_WORKERS 8 heroku buildpacks https://github.com/heroku/heroku-buildpack-multi.git heroku stack cedar-14
我的.buildpack文件
https://github.com/moohkooh/Nginx-buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
我也有猜测,那个heroku不使用我设置为80的variables。怎么了? 非常感谢任何人。
顺便说一句:我的快递服务器运行没有任何错误的端口1000(为testing我也启动它也在端口80没有任何错误)
使用Windows机器将Django部署到Heroku(生产服务器不开发服务器)
为什么“英雄创造”无所作为?
Heroku – 推送到git存储库的致命错误
parsingX-Forwarded – 在Heroku上用werkzeug获得IP
“领class”不被视为内部或外部的指挥
我用这个配置解决了我的问题。
daemon off; #Heroku dynos have at least 4 cores. worker_processes <%= ENV['Nginx_WORKERS'] || 4 %>; pid Nginx.pid; events { worker_connections 1024; } http { gzip on; gzip_comp_level 2; gzip_min_length 512; server_tokens off; log_format l2met 'measure#Nginx.service=$request_time request_id=$http_x_request_id'; access_log logs/Nginx/access.log l2met; error_log logs/Nginx/error.log; include mime.types; server { listen <%= ENV['PORT'] %>; server_name localhost; port_in_redirect off; keepalive_timeout 5; root /app/www; index index.html; location / { autoindex on; } } }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。