Ruby App Server Configuration

Ruby Application Server Configuration

The platform provides Ruby application servers based on Apache Ruby and NGINX Ruby. Both stacks use Passenger by default, while NGINX Ruby can also be configured to work with Puma or Unicorn.

Ruby Application Servers

The platform provides two managed Ruby application-server stacks:

  • Apache Ruby
  • NGINX Ruby

Both stacks are configured to use Passenger by default through the corresponding custom module.

PassengerA feature-rich application server for modern Ruby web applications and microservice APIs.
PumaA Ruby web server focused on speed and parallelism with fast HTTP/1.1 protocol parsing.
UnicornAn HTTP server that uses Unix and Unix-like kernel features for fast clients on low-latency, high-bandwidth connections.

NGINX Application-Server Modules

Passenger is enabled for every newly created Ruby environment by default. Follow the steps below to switch the NGINX Ruby server to Puma or Unicorn.

Switch the Active Module

1

Open the configuration manager

Click Config beside the NGINX Ruby application server.

NGINX Ruby server Config button
Open the NGINX Ruby configuration-file manager.
2

Open nginx.conf

In the configuration-file manager, open:

/etc/nginx/nginx.conf

Locate the following application-server include directives:

include app_servers/nginx-unicorn.conf;
include app_servers/nginx-puma.conf;
include app_servers/nginx-passenger.conf;
NGINX Ruby application-server include directives
Find the Passenger, Puma, and Unicorn include directives in nginx.conf.
3

Enable the required module

Uncomment the line for the required application server and comment the previously active line. The example shown in the source switches the server to Puma.

!

Only one module can be active

Keep only one application-server include directive enabled. Enabling multiple modules causes compatibility errors.

Adjust NGINX Ruby application-server module settings
Enable the required module and disable the previously active one.
4

Save and restart the nodes

Save the configuration changes and click Restart Nodes for the NGINX application-server layer.

Restart NGINX Ruby nodes
Restart the NGINX Ruby nodes to apply the module configuration.

Start Puma or Unicorn

5

Connect through SSH

Access the NGINX Ruby node through SSH, for example with Web SSH, and run the selected application server from the project directory.

Start Puma

cd /var/www/webroot/ROOT/
pumactl -F config/puma.rb --pidfile puma.pid -S puma.state start &

Start Unicorn

unicorn_rails -c config/unicorn.rb -D &
Start Puma on NGINX Ruby through SSH
Start the selected Ruby application server from the application directory.

Stop the Active Module

Before switching to another module, stop the currently running application server.

Stop Puma

pumactl -F config/puma.rb --pidfile puma.pid -S puma.state stop

Stop Unicorn

ps aux | grep 'unicorn' | awk '{print $2}' | xargs kill -QUIT

Expected Result

The NGINX Ruby server runs with the selected Passenger, Puma, or Unicorn module. Only one module remains active in the NGINX configuration, and the corresponding application server is started from the Ruby project directory.

Important Notes

  • Apache Ruby and NGINX Ruby use Passenger by default.
  • Puma and Unicorn are available only as alternative built-in servers for NGINX Ruby.
  • Only one application-server module must be enabled in nginx.conf.
  • Restart the NGINX nodes after changing the active module.
  • Run the Puma or Unicorn start command from /var/www/webroot/ROOT/.
  • Stop the current application server before switching to another one.