How to proxy SpringBoot application via Apache HTTPD

First we need to add the following to virtual host definition.
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

Enable the following modules:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Run SpringBoot application. Note that it starts on 127.0.0.1 interface. Also note that we pass extra parameter allowing for non-blocking entropy source.
/opt/jdk1.8.0_101/bin/java -Dserver.address=127.0.0.1 -Djava.security.egd=file:/dev/./urandom -jar spring-boot-app.jar &

Restart webserver
systemctl restart httpd

That's all folks!

Comments

Popular posts from this blog

Hardening OpenWRT - adding non-root user account

Dropbear SSH keys and autossh on OpenWRT

SSH Tunel with OpenWRT