JHipster (Spring, Angular), Vagrant - empty retry from server

I configured demo-spring-cas-angular to work with port 8081. When I run it on my machine (OSX), it works very well.

I have a problem when it runs inside the tramps. Port 8081 Sent

config.vm.network "forwarded_port", guest: 8080, host: 8080 config.vm.network "forwarded_port", guest: 8081, host: 8081 config.vm.network "forwarded_port", guest: 8761, host: 8761 config.vm.network "forwarded_port", guest: 5432, host: 5432 config.vm.network "forwarded_port", guest: 3306, host: 3306 config.vm.network "forwarded_port", guest: 8443, host: 8443 

I have no problems with ports other than 8081 (I have access to databases, eureka registry, CAS instance).

From OSX:

 curl http://localhost:8081/index.html#/ curl: (52) Empty reply from server 

From the tramp:

 curl http://localhost:8081/index.html#/ <!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> ... 

I do not see any exceptions while loading the application.

 Access URLs: ---------------------------------------------------------- Local: http://127.0.0.1:8081 External: http://127.0.0.1:8081 ---------------------------------------------------------- 

Is this a problem with the app or with the tramp? I tried to run another application on 8081 - the problem did not occur.

+1
source share
1 answer

you can change the host information from application-dev.yml to be

 server: port: 8081 address: 0.0.0.0 

therefore it will be accessible outside the VM

127.0.0.1 is a loopback , so if you assign this IP address (or localhost) to your server configuration, it is accessible from other network interfaces, so you cannot access it outside the virtual machine. If you bind your server to 0.0.0.0 its accessible for all interfaces

+3
source

All Articles