Nginx phusion_passenger throws a configuration template error: unknown directive

Started by mahesh, Jan 23, 2025, 04:40 AM

Previous topic - Next topic

mahesh

Symptoms
  • Plesk Obsidian running on a Linux-based operating system
  • After installing the NodeJS component for Plesk, the following error is shown at Plesk Home page:
Apache config (14816524790.56007300) generation failed: Template_Exception: nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/conf.d/phusion-passenger.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

Cause
The issue is caused by a known Plesk bug with ID #PPPM-6313, which will be fixed in future versions of Plesk.

You may track the resolution for the bug in question in the Change Log for Plesk Obsidian.

Resolution
Until the bug is fixed permanently, as a workaround, you may do the following:

1.Log into the server via SSH

2.Edit the /etc/nginx/nginx.conf file with your favorite command-line text editor and add the following directive right before the events { section:

include /etc/nginx/modules.conf.d/*.conf;
Warning: Make sure that it is added before other configurations includes (for example, right after pid file), to load all modules before directive(s) used by some particular module will be declared.

3.Make sure that configuration file /etc/nginx/modules.conf.d/phusion-passenger.conf (which is loading the phusion passenger module) exists and has the following content:

#cat /etc/nginx/modules.conf.d/phusion-passenger.conf
load_module nginx/modules/ngx_http_passenger_module.so;

4.Restart the nginx service by executing the following command:

#systemctl restart nginx