bryla33 bryla33 - 3 months ago 17
AngularJS Question

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

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

I have problem when it is run inside vagrant. Port 8081 is forwarded

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 don't have problems with other ports besides 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 vagrant:

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 don't see any exceptions during application boot.

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


It is problem with application or with vagrant? I tried to run another application on 8081 - problem didn't occur.

Answer

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

server:
    port: 8081
    address: 0.0.0.0

so it will be available outside of the VM