Creé la aplicación Vertx que contiene 2 verticles. 1 se ejecuta en el puerto 8888 y el otro se ejecuta en el 8881.
Estoy tratando de implementar la aplicación en Elastic beanstalk. Pero recibo el error 502 Bad Gateway.
Aquí está el lugar del archivo de configuración nginx en .ebextensions/nginx/nginx.conf
user nginx; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_processes auto; worker_rlimit_nofile 33282; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; include conf.d/*.conf; map $http_upgrade $connection_upgrade { default "upgrade"; } server { listen 5000; root /var/app/current/public; location / { } location /api { proxy_pass http://127.0.0.1:8888; proxy_http_version 1.1; proxy_set_header Connection $connection_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /api2 { proxy_pass http://127.0.0.1:8881; proxy_http_version 1.1; proxy_set_header Connection $connection_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } access_log /var/log/nginx/access.log main; client_header_timeout 60; client_body_timeout 60; keepalive_timeout 60; gzip off; gzip_comp_level 4; # Include the Elastic Beanstalk generated locations include conf.d/elasticbeanstalk/01_static.conf; include conf.d/elasticbeanstalk/healthd.conf; } } Aquí está el archivo buildspec.yml de buildspec.yml :
version: 0.2 phases: install: runtime-versions: java: corretto11 build: commands: - echo Build started on 'date' - gradle bootJar post_build: commands: - echo Build completed on 'date' - ls build/libs - mv build/libs/*.jar app.jar - ls artifacts: files: - app.jar - .ebextensions/**/*Instalé nginx en mi máquina local y con la configuración anterior funciona bien.
¿Me he perdido algo?