1

Is there a (recommended) way to determine within nginx.conf.erb the app_type that Phusion Passenger (in standalone mode) has autodetected, per its autodetection algorithm? In Passenger 5.1.8, we'd been relying on AppFinder.looks_like_app_directory?, but it looks like that's been made private in 5.1.11.

We could simply look for any of ["config.ru", "passenger_wsgi.py", "app.js", ".meteor"] ourselves but would prefer to rely on the app_type already detected, particularly if it was manually specified with --app-type at the command line.

David J. Malan
  • 33
  • 2
  • 12

1 Answers1

0

Assuming you are in a server block, then <%= nginx_option(app, :app_type) %> should work for you.

If you just need it for conditional stuff, not output then app[:app_type] is what you want.

Camden Narzt
  • 2,271
  • 1
  • 23
  • 42
  • Thanks for the follow-up. Though it looks like `:app_type` is only populated (in 5.1.8 and 5.1.11, at least) with a value (in the context of `nginx.conf.erb`) when `--app-type` is specified at the command line and not when autodetection is used? – David J. Malan Oct 23 '17 at 20:18
  • Yeah this only gets you the overrides, the autodetection is done in the c++ passenger core in all cases except passenger enterprise mass deployment. So you'll want to look for the startup files and then defer to `app[:app_type]` if set. – Camden Narzt Oct 24 '17 at 14:50