lib/rconf/configurators/passenger_configurator.rb in rconf-0.9.18 vs lib/rconf/configurators/passenger_configurator.rb in rconf-0.9.19
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
+# Copyright (C) 2011-2012 RightScale, Inc, All Rights Reserved Worldwide.
#
# THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
# AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
# reproduction, modification, or disclosure of this program is
# strictly prohibited. Any use of this program by an authorized
@@ -30,11 +30,11 @@
settings :library_src_path => "Path to library sources, #{File.expand_path(File.join(Dir.getwd, '..', 'library'))} by default",
:gem_version => "Passenger gem version #{PASSENGER_GEM_VERSION} by default",
:install_path => 'Path to nginx installation directory, uses /opt/nginx if it ' +
'is writable by the current user or ~/nginx otherwise by default'
-
+
# Check that passenger gem is installed and that passenger+nginx is installed
#
# === Return
# true:: If both are installed
# false:: Otherwise
@@ -73,11 +73,11 @@
install_passenger
true
end
alias :run_darwin :run_linux
- # Not implemented on windows
+ # Not implemented on windows
#
# === Raise
# (Exception):: Always raise
def run_windows
raise "Passenger is not supported on Windows!"
@@ -139,11 +139,11 @@
report_success
end
# Install passenger+nginx
#
- # === Return
+ # === Return
# true:: Always return true
def install_passenger
report_check('Installing passenger+nginx')
# Grrrrr passenger installer expect rake where it's not... HACK
ruby_dir = File.dirname(`which ruby`.chomp)
@@ -182,11 +182,11 @@
# Nginx error log path
def log_path
File.join(install_path, 'logs', 'nginx-error.log')
end
-
+
# Nginx pid file path
def pid_path
File.join(install_path, 'logs', 'nginx.pid')
end
@@ -230,98 +230,98 @@
gzip on;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.";
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
-
+
server {
ssi on;
listen 3000;
server_name right-site.rightscale.local;
root #{File.join(right_site_src_path, 'public')};
passenger_enabled on;
rails_env development;
-
+
# POST and AJAX requests need to proxied directly to the library app
#####################################################################
set $is_library_direct "";
-
+
# provisioning routes to the library
if ($request_uri ~ ^/provisioning)
{
rewrite ^/provisioning(.*)$ /direct_library/provisioning$1 last;
}
-
+
if ($request_uri ~ ^/aria_provisioning_callbacks)
{
rewrite ^/aria_provisioning_callbacks(.*)$ /direct_library/aria_provisioning_callbacks$1 last;
}
-
- # request is for a library related action
+
+ # request is for a library related action
if ($request_uri ~ ^/library/)
{
set $is_library_direct L;
}
-
+
# request is a POST
if ($request_method = POST)
{
- set $is_library_direct "${is_library_direct}P";
+ set $is_library_direct "${is_library_direct}P";
}
-
+
# request is an AJAX
if ($http_x_requested_with = XMLHttpRequest)
- {
+ {
set $is_library_direct "${is_library_direct}A";
}
-
+
# library post request should be directly proxied
if ($is_library_direct = LP)
{
rewrite ^/library/(.*)$ /direct_library/$1 last;
}
-
+
# library post ajax request should be directly proxied
if ($is_library_direct = LPA)
{
rewrite ^/library/(.*)$ /direct_library/$1 last;
}
-
+
# library ajax request should be directly proxied
if ($is_library_direct = LA)
{
rewrite ^/library/(.*)$ /direct_library/$1 last;
}
#####################################################################
-
+
location /direct_library/
{
proxy_pass http://library.rightscale.local:3001/;
proxy_set_header X-Relative-Root library;
proxy_set_header X-Embedded on;
proxy_set_header X-Core-Site-Domain right-site.rightscale.local;
}
-
+
location ~ ^/library/users/(.+)/openid_consume
{
proxy_pass http://library.rightscale.local:3001/users/$1/openid_consume?$args;
proxy_set_header X-Relative-Root library;
proxy_set_header X-Embedded on;
}
-
-
+
+
location ~ ^/library/(.*).(css|js)
{
- # library assets get proxied directly to the library app
+ # library assets get proxied directly to the library app
proxy_pass http://library.rightscale.local:3001/$1.$2;
}
-
+
location /library_images/
{
proxy_pass http://library.rightscale.local:3001/library_images/;
}
-
-
+
+
location /library_rest/
{
proxy_pass http://127.0.0.1:3001/;
proxy_set_header X-Relative-Root library;
proxy_set_header X-Core-Site-Domain right-site.rightscale.local;