Skip to content

Configure Nginx for PIA BACK

Kevin Beyrand edited this page Jan 26, 2024 · 12 revisions

For NGINX server

Find the path to ruby with which ruby

Create a config file:

sudo nano /etc/nginx/sites-available/pia-back

Beware with the port here, <VirtualHost *:80> it might be a different port for you, if for example your Front already uses this one.

server {
    listen 80;
    server_name _YOUR_DOMAIN_NAME_;

    # Tell Nginx and Passenger where your app's 'public' directory is
    root /var/www/pia-back;

    # Turn on Passenger
    passenger_enabled on;
    passenger_ruby _PATH_TO_RUBY_;
}

Enable this new site:

  • sudo ln -s /etc/nginx/sites-available/pia-back /etc/nginx/sites-enabled/pia-back

Reload Nginx:

  • sudo systemctl reload nginx

If you have made some update on pia-back, please restart the application following the Passenger documentation https://www.phusionpassenger.com/library/admin/apache/restart_app.html