Apache 弹性豆茎返回503个错误
我的Elastic Beanstalk应用程序返回503服务器的容量错误。我知道当无法访问应用程序时会发生这种情况,但应用程序在其他任何地方都是稳定的,我已经对其进行了测试 我认为问题在于我的nginx.conf覆盖:Apache 弹性豆茎返回503个错误,apache,amazon-web-services,nginx,amazon-ec2,amazon-elastic-beanstalk,Apache,Amazon Web Services,Nginx,Amazon Ec2,Amazon Elastic Beanstalk,我的Elastic Beanstalk应用程序返回503服务器的容量错误。我知道当无法访问应用程序时会发生这种情况,但应用程序在其他任何地方都是稳定的,我已经对其进行了测试 我认为问题在于我的nginx.conf覆盖: "/opt/elasticbeanstalk/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf" : mode: "000664" owner: root group: root encoding: plain content:
"/opt/elasticbeanstalk/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf" :
mode: "000664"
owner: root
group: root
encoding: plain
content: |
#WE COME FROM env.config!
upstream nodejs {
server 127.0.0.1:8081;
keepalive 256;
}
server {
listen 80;
if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") {
set $year $1;
set $month $2;
set $day $3;
set $hour $4;
}
access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
access_log /var/log/nginx/access.log main;
location / {
root /var/app/current/public/dist;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
gzip on;
gzip_comp_level 4;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
}
container_commands:
01_replace_nginx_eb_conf:
command: "mv -f '/opt/elasticbeanstalk/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf' '/tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf'"
ignoreErrors: false
我希望能够通过EBS为包含React web应用程序的应用程序的“dist”文件夹提供服务
我对DevOps或nginx不是很熟悉。这里是否有任何明显的问题会导致我的应用程序始终处于503状态?您查看了日志吗?是的,日志中没有任何内容表明失败的应用程序运行正常。nginx日志中没有任何会使整个应用程序崩溃的警告。。。可能需要换个方向。或者共享日志,以防丢失某些内容。至于另一个方向,如果您不需要ec2实例上的任何后端服务,那么请尝试S3静态托管或Github页面。这两个都适用于前端框架。你检查过日志了吗?是的,日志中没有任何东西表明某个失败的应用程序运行正常。nginx日志中没有任何会使整个应用程序崩溃的警告。。。可能需要换个方向。或者共享日志,以防丢失某些内容。至于另一个方向,如果您不需要ec2实例上的任何后端服务,那么请尝试S3静态托管或Github页面。这两种方法都适用于前端框架。