NGINX and Resoa

If you need to integrate Java services within other web application technologies like PHP or NodeJS, NGINX currently might be the best choice for your main HTTP server.
You easily can run a ResoaGateway as a standalone container, listing to for all service calls. As an example, set up a Jetty embedded  Resoa service container:

public JettyEmbeddedContainer() {
	Server server = new Server();
	ServerConnector http = new ServerConnector(server);
	http.setPort(8080); //listen on port 8080
	// add the connector
	try {
		// create a Jetty servlet handler
		ServletHandler handler = new ServletHandler();
		// set up a LocalContainerServlet, first argument is the gateway root path, second the classpath of your service implementation files
		ServletHolder servlet = new ServletHolder(new LocalContainerServlet ("/resoa/resources", "${jetty.base}/lib/ext"));
		// listen to all incoming requests
		handler.addServletWithMapping(servlet, "/*");
	} catch (Exception e) {

Host/Dispatcher configuration of the LocalContainerServlet

The LocalContainerServlet looks for a folder named hosts within the gateway root. Simply put Rest service configuration xml files into this folder. As an example:

<Rest xmlns="">
	<!-- Define the Host domains -->
	<Hosts cookieDomain="" domain=""/>
	<Hosts cookieDomain="" domain="" />
	<!-- Define the URL to service dispatching -->
		<!-- Resoa URL to Service package routing. Map the java package name of your service model to an URL -->
		<Services path="/service/partner" package="" />
		<Services path="/service/products" package="" />
		<Services path="/service/main" package="" />
		<Services path="/service/media" package="" />

NGINX configuration example

Example configuration of a virtual server providing access to Resoa services within nginx.conf.

# Virtual Server configuration
	server {
	listen       80;
	root   /webroot/;
	# pass Resoa service calls
	location /service/ {
		proxy_set_header  X-Real-IP  $remote_addr;
		proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header  Host $http_host;
	# add further locations, i.e. PHP FastCGI, etc

Check the NGINX reverser proxy configuration documentation for more information about.