Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Make CONFIG_PATH nginx compatible. #70

Open
brodock opened this issue May 12, 2011 · 3 comments
Open

Make CONFIG_PATH nginx compatible. #70

brodock opened this issue May 12, 2011 · 3 comments
Labels

Comments

@brodock
Copy link

brodock commented May 12, 2011

There is no way to define ENV['CONFIG_PATH'] on nginx, but passenger has a similar way:

passenger_set_cgi_param CONFIG_PATH "/var/lib/visage";

But by this way, you define the request.env not the "system environment". This leads to the problem that Visage has to try to load profiles only after the first HTTP resquest (and not preloaded on application startup).

I also crafter a "vhost" example to be used with nginx + passenger:

server {
listen 80;
server_name visage.domain.com;
root /home/visage/.gems/visage-app-0.9.6/lib/visage-app/public; # <--- be sure to point to 'public'!
passenger_enabled on;
passenger_set_cgi_param CONFIG_PATH "/home/visage/visage-config";
}

@auxesis
Copy link
Owner

auxesis commented May 13, 2011

Hey there,
Thanks for the Nginx fragment - very useful!

That's a bummer about Nginx's environment variable stuff. I'm not really comfortable passing is CONFIG_PATH as a CGI parameter.

Have you considered running Nginx as a reverse proxy for Visage running on another port?

@auxesis
Copy link
Owner

auxesis commented May 14, 2011

To clarify why I'm not comfortable: although CONFIG_PATH is checked every time a file is loaded, it's sourced from an environment variable, rather than passed as an option. Passing it as an option will significantly complicate the current code.

That said, it's a completely valid use case that should be handled. The config system needs a bit of a redesign (which will happen for the 1.1 release), and I think it should definitely handle this case.

@brodock
Copy link
Author

brodock commented May 15, 2011

Thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants