3

I'm trying to access the static files from a front-backend jar project in Spring Boot that I've uploaded to AWS Elastic Beanstalk. The front project was made in React 16.13.1 and the back in Spring Boot 2.2.5.

Currently, when I access to the URL that AWS provides, the page stays in "loading" but shows the name of my app (the one that I defined in the index.html), even shows some of the static but incomplete files that I have in my project and ends with a ERR_CONNECTION_TIMED_OUT in the web browser console for each one of the static files. The endpoints that the front project uses are working properly, I tested them with Postman.

ERR_TIMED_OUT

I've checked the logs of the EC2 machine but nothing inusual is in there and the deploy status is OK in Elastic Beanstalk GUI. I tried to change the access ports of the security groups in the EC2 machine and if I allow the port 443 the error chages to ERR_CONNECTION_REFUSED.

ERR_CONNECTION_REFUSED

I've run several times the jar in local and gets a normal response (I mean, everything works fine: shows the React project) with all the content under /resources/static folder in the Spring project (before build). Even I made sure that the .jar file after build had those files with jar tvf front-back-project.jar. They are under META-INF/classes/static/.

I do not know what else to check. I'd appreciate any help. Thanks in advice.

Some logs over here (the full logs can be found here):

----------------------------------------
/var/log/nginx/access.log
----------------------------------------
187.207.185.202 - - [26/May/2020:00:49:37 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.66" "-"
187.207.185.202 - - [26/May/2020:01:49:16 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36" "-"
187.207.185.202 - - [26/May/2020:01:49:29 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.66" "-"
187.207.185.202 - - [26/May/2020:02:45:22 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.66" "-"
187.207.185.202 - - [26/May/2020:02:52:34 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.66" "-"
187.207.185.202 - - [26/May/2020:02:56:45 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.66" "-"
209.17.96.58 - - [26/May/2020:04:18:08 +0000] "GET / HTTP/1.0" 400 435 "-" "Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)" "-"
187.207.185.202 - - [26/May/2020:05:26:44 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36" "-"
187.207.185.202 - - [26/May/2020:05:26:46 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36" "-"
187.207.185.202 - - [26/May/2020:05:26:48 +0000] "GET / HTTP/1.1" 200 2582 "-" "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36" "-"


----------------------------------------
/var/log/nginx/error.log
----------------------------------------


----------------------------------------
/var/log/eb-engine.log
----------------------------------------
2020/05/26 02:56:30.942438 [INFO] Running command /bin/sh -c systemctl stop eb-app.target
2020/05/26 02:56:30.950433 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf eb-app.target | cut -d= -f2
2020/05/26 02:56:30.972044 [INFO] web.service

2020/05/26 02:56:30.972092 [INFO] Running command /bin/sh -c systemctl show -p PartOf web.service
2020/05/26 02:56:30.990995 [INFO] Running command /bin/sh -c systemctl is-active web.service
2020/05/26 02:56:31.003968 [INFO] Running command /bin/sh -c systemctl disable web.service
2020/05/26 02:56:31.100172 [ERROR] Removed symlink /etc/systemd/system/multi-user.target.wants/web.service.

2020/05/26 02:56:31.100280 [INFO] Running command /bin/sh -c systemctl daemon-reload
2020/05/26 02:56:31.194354 [INFO] Running command /bin/sh -c systemctl reset-failed
2020/05/26 02:56:31.203617 [INFO] Register application processes...
2020/05/26 02:56:31.203635 [INFO] Registering the proc: web

2020/05/26 02:56:31.203655 [INFO] Running command /bin/sh -c systemctl show -p PartOf web.service
2020/05/26 02:56:31.211034 [INFO] Running command /bin/sh -c systemctl daemon-reload
2020/05/26 02:56:31.289318 [INFO] Running command /bin/sh -c systemctl reset-failed
2020/05/26 02:56:31.293528 [INFO] Running command /bin/sh -c systemctl is-enabled eb-app.target
2020/05/26 02:56:31.297178 [INFO] Running command /bin/sh -c systemctl enable eb-app.target
2020/05/26 02:56:31.374729 [INFO] Running command /bin/sh -c systemctl start eb-app.target
2020/05/26 02:56:31.380127 [INFO] Running command /bin/sh -c systemctl enable web.service
2020/05/26 02:56:31.462509 [ERROR] Created symlink from /etc/systemd/system/multi-user.target.wants/web.service to /etc/systemd/system/web.service.

2020/05/26 02:56:31.462552 [INFO] Running command /bin/sh -c systemctl show -p PartOf web.service
2020/05/26 02:56:31.467886 [INFO] Running command /bin/sh -c systemctl is-active web.service
2020/05/26 02:56:31.471668 [INFO] Running command /bin/sh -c systemctl start web.service
2020/05/26 02:56:31.490156 [INFO] Executing instruction: start X-Ray
2020/05/26 02:56:31.490171 [INFO] X-Ray is not enabled.
2020/05/26 02:56:31.490176 [INFO] Executing instruction: start proxy with new configuration
2020/05/26 02:56:31.490209 [INFO] Running command /bin/sh -c /usr/sbin/nginx -t -c /var/proxy/staging/nginx/nginx.conf
2020/05/26 02:56:31.509143 [ERROR] nginx: the configuration file /var/proxy/staging/nginx/nginx.conf syntax is ok
nginx: configuration file /var/proxy/staging/nginx/nginx.conf test is successful

2020/05/26 02:56:31.509403 [INFO] Running command /bin/sh -c cp -rp /var/proxy/staging/nginx/. /etc/nginx
2020/05/26 02:56:31.516223 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2020/05/26 02:56:31.522826 [WARN] Warning: process nginx is already registered...
Deregistering the process ...
2020/05/26 02:56:31.522850 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2020/05/26 02:56:31.533978 [INFO] Running command /bin/sh -c systemctl is-active nginx.service
2020/05/26 02:56:31.543742 [INFO] Running command /bin/sh -c systemctl disable nginx.service
2020/05/26 02:56:31.683440 [INFO] Running command /bin/sh -c systemctl daemon-reload
2020/05/26 02:56:31.813625 [INFO] Running command /bin/sh -c systemctl reset-failed
2020/05/26 02:56:31.823722 [INFO] Running command /bin/sh -c systemctl daemon-reload
2020/05/26 02:56:31.977355 [INFO] Running command /bin/sh -c systemctl reset-failed
2020/05/26 02:56:31.986970 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2020/05/26 02:56:32.003330 [INFO] Running command /bin/sh -c systemctl is-active nginx.service
2020/05/26 02:56:32.017649 [INFO] Running command /bin/sh -c systemctl start nginx.service
2020/05/26 02:56:32.134076 [INFO] Executing instruction: configureSqsd
2020/05/26 02:56:32.134095 [INFO] This is a web server environment instance, skip configure sqsd daemon ...
2020/05/26 02:56:32.134100 [INFO] Executing instruction: startSqsd
2020/05/26 02:56:32.134104 [INFO] This is a web server environment instance, skip start sqsd daemon ...
2020/05/26 02:56:32.134108 [INFO] Executing instruction: Track pids in healthd
2020/05/26 02:56:32.134113 [INFO] This is an enhanced health env...
2020/05/26 02:56:32.134132 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf aws-eb.target | cut -d= -f2
2020/05/26 02:56:32.151082 [INFO] nginx.service healthd.service cfn-hup.service

2020/05/26 02:56:32.151118 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf eb-app.target | cut -d= -f2
2020/05/26 02:56:32.167936 [INFO] web.service

2020/05/26 02:56:32.168102 [INFO] Executing instruction: RunPostDeployHooks
2020/05/26 02:56:32.168113 [INFO] The dir .platform/hooks/postdeploy/ does not exist in the application. Skipping this step...
2020/05/26 02:56:32.168118 [INFO] Executing cleanup logic
2020/05/26 02:56:32.168186 [INFO] CommandService Response: {"status":"SUCCESS","api_version":"1.0","results":[{"status":"SUCCESS","msg":"Engine execution has succeeded.","returncode":0,"events":[]}]}

2020/05/26 02:56:32.168346 [INFO] Platform Engine finished execution on command: app-deploy

2020/05/26 05:07:57.980813 [INFO] Starting...
2020/05/26 05:07:57.980864 [INFO] Starting EBPlatform-PlatformEngine
2020/05/26 05:07:57.980927 [INFO] no eb envtier info file found, skip loading env tier info.
2020/05/26 05:07:57.980983 [INFO] Engine received EB command cfn-hup-exec

2020/05/26 05:07:58.207543 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:389420796005:stack/awseb-e-nm3vwd4dbq-stack/59718850-9eea-11ea-8632-0e794c84352f -r AWSEBAutoScalingGroup --region us-east-1
2020/05/26 05:07:58.490501 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:389420796005:stack/awseb-e-nm3vwd4dbq-stack/59718850-9eea-11ea-8632-0e794c84352f -r AWSEBBeanstalkMetadata --region us-east-1
2020/05/26 05:07:58.770536 [INFO] checking whether command bundle-log is applicable to this instance...
2020/05/26 05:07:58.770558 [INFO] this command is applicable to the instance, thus instance should execute command
2020/05/26 05:07:58.770562 [INFO] Engine command: (bundle-log)

2020/05/26 05:07:58.770610 [INFO] Executing instruction: GetBundleLogs
2020/05/26 05:07:58.770615 [INFO] Bundle Logs...
2020/05/26 05:07:58.972754 [INFO] Executing cleanup logic
2020/05/26 05:07:58.972827 [INFO] CommandService Response: {"status":"SUCCESS","api_version":"1.0","results":[{"status":"SUCCESS","msg":"Engine execution has succeeded.","returncode":0,"events":[]}]}

2020/05/26 05:07:58.972842 [INFO] Platform Engine finished execution on command: bundle-log

2020/05/26 05:26:52.992259 [INFO] Starting...
2020/05/26 05:26:52.992316 [INFO] Starting EBPlatform-PlatformEngine
2020/05/26 05:26:52.992377 [INFO] no eb envtier info file found, skip loading env tier info.
2020/05/26 05:26:52.992445 [INFO] Engine received EB command cfn-hup-exec

2020/05/26 05:26:53.149141 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:389420796005:stack/awseb-e-nm3vwd4dbq-stack/59718850-9eea-11ea-8632-0e794c84352f -r AWSEBAutoScalingGroup --region us-east-1
2020/05/26 05:26:53.483526 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:389420796005:stack/awseb-e-nm3vwd4dbq-stack/59718850-9eea-11ea-8632-0e794c84352f -r AWSEBBeanstalkMetadata --region us-east-1
2020/05/26 05:26:53.764072 [INFO] checking whether command tail-log is applicable to this instance...
2020/05/26 05:26:53.764106 [INFO] this command is applicable to the instance, thus instance should execute command
2020/05/26 05:26:53.764119 [INFO] Engine command: (tail-log)

2020/05/26 05:26:53.764169 [INFO] Executing instruction: GetTailLogs
2020/05/26 05:26:53.764174 [INFO] Tail Logs...
2020/05/26 05:26:53.764412 [INFO] Running command /bin/sh -c tail -n 100 /var/log/nginx/access.log
2020/05/26 05:26:53.766128 [INFO] Running command /bin/sh -c tail -n 100 /var/log/nginx/error.log
2020/05/26 05:26:53.767652 [INFO] Running command /bin/sh -c tail -n 100 /var/log/eb-engine.log


----------------------------------------
/var/log/web.stdout.log
----------------------------------------
May 26 02:56:33 ip-172-31-47-58 web: .   ____          _            __ _ _
May 26 02:56:33 ip-172-31-47-58 web: /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
May 26 02:56:33 ip-172-31-47-58 web: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
May 26 02:56:33 ip-172-31-47-58 web: \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
May 26 02:56:33 ip-172-31-47-58 web: '  |____| .__|_| |_|_| |_\__, | / / / /
May 26 02:56:33 ip-172-31-47-58 web: =========|_|==============|___/=/_/_/_/
May 26 02:56:33 ip-172-31-47-58 web: :: Spring Boot ::        (v2.2.5.RELEASE)
May 26 02:56:34 ip-172-31-47-58 web: 2020-05-26 02:56:34.207  INFO 31614 --- [           main] c.a.a.AgroupServerApplication            : Starting AgroupServerApplication v0.0.1-SNAPSHOT on ip-172-31-47-58.ec2.internal with PID 31614 (/var/app/current/application.jar started by webapp in /var/app/current)
May 26 02:56:34 ip-172-31-47-58 web: 2020-05-26 02:56:34.218  INFO 31614 --- [           main] c.a.a.AgroupServerApplication            : No active profile set, falling back to default profiles: default
May 26 02:56:35 ip-172-31-47-58 web: 2020-05-26 02:56:35.636  INFO 31614 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
May 26 02:56:35 ip-172-31-47-58 web: 2020-05-26 02:56:35.800  INFO 31614 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 150ms. Found 2 repository interfaces.
May 26 02:56:37 ip-172-31-47-58 web: 2020-05-26 02:56:37.073  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dynamoDBConfiguration' of type [com.agroupapp.agroupserver.configurations.DynamoDBConfiguration$$EnhancerBySpringCGLIB$$77a5bb7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:38 ip-172-31-47-58 web: 2020-05-26 02:56:38.730  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'amazonDynamoDB' of type [com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:38 ip-172-31-47-58 web: 2020-05-26 02:56:38.780  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dynamoDB-DynamoDBMapperConfig' of type [com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:38 ip-172-31-47-58 web: 2020-05-26 02:56:38.886  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:38 ip-172-31-47-58 web: 2020-05-26 02:56:38.894  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:38 ip-172-31-47-58 web: 2020-05-26 02:56:38.899  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@2555fff0' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:38 ip-172-31-47-58 web: 2020-05-26 02:56:38.905  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:38 ip-172-31-47-58 web: 2020-05-26 02:56:38.914  INFO 31614 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
May 26 02:56:39 ip-172-31-47-58 web: 2020-05-26 02:56:39.516  INFO 31614 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
May 26 02:56:39 ip-172-31-47-58 web: 2020-05-26 02:56:39.544  INFO 31614 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
May 26 02:56:39 ip-172-31-47-58 web: 2020-05-26 02:56:39.548  INFO 31614 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.31]
May 26 02:56:39 ip-172-31-47-58 web: 2020-05-26 02:56:39.691  INFO 31614 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
May 26 02:56:39 ip-172-31-47-58 web: 2020-05-26 02:56:39.692  INFO 31614 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 5328 ms
May 26 02:56:40 ip-172-31-47-58 web: 2020-05-26 02:56:40.096  INFO 31614 --- [           main] o.s.s.d.d.r.s.DynamoDBRepositoryFactory  : Spring Data DynamoDB Version: 5.1.0 (2.1)
May 26 02:56:40 ip-172-31-47-58 web: 2020-05-26 02:56:40.100  INFO 31614 --- [           main] o.s.s.d.d.r.s.DynamoDBRepositoryFactory  : Spring Data Version:          2.1.9.RELEASE
May 26 02:56:40 ip-172-31-47-58 web: 2020-05-26 02:56:40.101  INFO 31614 --- [           main] o.s.s.d.d.r.s.DynamoDBRepositoryFactory  : AWS SDK Version:              1.11.614
May 26 02:56:40 ip-172-31-47-58 web: 2020-05-26 02:56:40.102  INFO 31614 --- [           main] o.s.s.d.d.r.s.DynamoDBRepositoryFactory  : Java Version:                 11.0.7 - OpenJDK 64-Bit Server VM 11.0.7+10-LTS
May 26 02:56:40 ip-172-31-47-58 web: 2020-05-26 02:56:40.102  INFO 31614 --- [           main] o.s.s.d.d.r.s.DynamoDBRepositoryFactory  : Platform Details:             Linux 4.14.173-137.229.amzn2.x86_64
May 26 02:56:41 ip-172-31-47-58 web: 2020-05-26 02:56:41.500  INFO 31614 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page: class path resource [static/index.html]
May 26 02:56:41 ip-172-31-47-58 web: 2020-05-26 02:56:41.724  INFO 31614 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@70101687, org.springframework.security.web.context.SecurityContextPersistenceFilter@6e57b5e9, org.springframework.security.web.header.HeaderWriterFilter@66f659e6, org.springframework.web.filter.CorsFilter@70e889e9, org.springframework.security.web.authentication.logout.LogoutFilter@51d143a1, com.agroupapp.agroupserver.security.jwt.AuthTokenFilter@5d1e09bc, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6a0ac48e, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@971e903, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@418c020b, org.springframework.security.web.session.SessionManagementFilter@50f40653, org.springframework.security.web.access.ExceptionTranslationFilter@63fdffcd]
May 26 02:56:42 ip-172-31-47-58 web: 2020-05-26 02:56:42.380  INFO 31614 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
May 26 02:56:42 ip-172-31-47-58 web: 2020-05-26 02:56:42.641  INFO 31614 --- [           main] d.d.r.u.Entity2DynamoDBTableSynchronizer : Checking repository classes with DynamoDB tables User, Sensor for ContextRefreshedEvent
May 26 02:56:42 ip-172-31-47-58 web: 2020-05-26 02:56:42.713  INFO 31614 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
May 26 02:56:42 ip-172-31-47-58 web: 2020-05-26 02:56:42.721  INFO 31614 --- [           main] c.a.a.AgroupServerApplication            : Started AgroupServerApplication in 9.766 seconds (JVM running for 11.233)
May 26 02:56:45 ip-172-31-47-58 web: 2020-05-26 02:56:45.752  INFO 31614 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
May 26 02:56:45 ip-172-31-47-58 web: 2020-05-26 02:56:45.753  INFO 31614 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
May 26 02:56:45 ip-172-31-47-58 web: 2020-05-26 02:56:45.777  INFO 31614 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 23 ms
sebastian_mp
  • 61
  • 1
  • 9
  • Are your ports correctly set in the security groups and on your load balancer (if you have one). – Marcin May 26 '20 at 06:23
  • Yes, I have the default configuration (the one that creates when an elastic beanstalk app is depolyed). The 80 port is allowed in the inbound rules and all traffic in outbound. I added the 443 port in inbound rules and I got the ERR_CONNECTION_REFUSED error that I explained in the question. – sebastian_mp May 26 '20 at 06:55
  • 443 is for ssl? In your question you do not write how and if you even setup ssl certificates? – Marcin May 26 '20 at 06:58
  • Because I wont use SSL. It's just a weird behavior that I wanted to show – sebastian_mp May 26 '20 at 07:02
  • Other thing strange is that only the front files (html, css and js) are not avaliable because I can access the endpoints (requesting JSON data) from the server URL without any problem. – sebastian_mp May 26 '20 at 07:03
  • Are you using spring security? there you may need to allow .js, .css and .html files to be accessible without authentication. – Rohit Patidar May 26 '20 at 07:16
  • Yes, I'm using Spring Security. I'm going to check and then I'll comment again – sebastian_mp May 26 '20 at 07:26
  • Use this https://stackoverflow.com/a/48363648/9103511 – Rohit Patidar May 26 '20 at 12:31
  • No, it did not work. I added the routes `/static/**`, `/css/**` and `/js/**` and the others that @RohitPatidar suggested but none of them works. I've realized something else, that the URL request of the static content after deployed changes from http://... to https://... Why does this happen? I have not configurated anything related to SSL or TLS – sebastian_mp May 26 '20 at 16:32
  • 1
    the logs you provided are not helpful try printing those at a finer level, also it would help if you could include .properties and WebMvcConfigurationAdapter implementation. – Rohit Patidar May 27 '20 at 05:52
  • I do not know what other logs do you mean by "finer". Those are the logs that AWS provides and the full logs are in the question. Anyway I have chosen to upload the project to Heroku, and there was no problem accessing the static content there. Thanks – sebastian_mp May 27 '20 at 17:33
  • @sebastian_mp Ever figured the reason why ? I am facing same issue ... – Dhrumil Bhankhar Nov 11 '20 at 07:21
  • Unfortunately I didn't found a solution @DhrumilBhankhar. I just hosted the static content in a different project in S3 – sebastian_mp Nov 14 '20 at 05:35

0 Answers0