lib/rconf/configurators/passenger_configurator.rb in rconf-0.9.22 vs lib/rconf/configurators/passenger_configurator.rb in rconf-0.9.23

- old
+ new

@@ -228,11 +228,10 @@ passenger_max_instances_per_app 1; include mime.types; default_type application/octet-stream; - sendfile on; keepalive_timeout 65; gzip on; gzip_buffers 16 8k; @@ -240,100 +239,158 @@ 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; + listen 3080; server_name right-site.rightscale.local; root #{File.join(right_site_src_path, 'public')}; passenger_enabled on; rails_env development; + # Sketchy Redirects + # Send sketchy references to the appropriate URL/port + location ~ /sketchy2-4/ { + proxy_pass http://46.137.105.242$request_uri; + } + # 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; + 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 and Ajax request should be directly proxied + if ( $is_library_direct ~ (LP|LPA|LA) ) { - set $is_library_direct "${is_library_direct}A"; + rewrite ^/library/(.*)$ /direct_library/$1 last; } - # library post request should be directly proxied - if ($is_library_direct = LP) + location /direct_library/ { - rewrite ^/library/(.*)$ /direct_library/$1 last; + proxy_pass http://library.rightscale.local:8080/; + proxy_set_header X-Embedded on; + proxy_set_header X-Relative-Root library; + proxy_set_header X-Core-Site-Domain 'right-site.rightscale.local'; } - # library post ajax request should be directly proxied - if ($is_library_direct = LPA) + location /library_rest/ { - rewrite ^/library/(.*)$ /direct_library/$1 last; + proxy_pass http://library.rightscale.local:8080/; + proxy_set_header X-Embedded on; + proxy_set_header X-Relative-Root library; + proxy_set_header X-Core-Site-Domain 'right-site.rightscale.local'; } - # library ajax request should be directly proxied - if ($is_library_direct = LA) + location /library/publishing_assistant/image_upload_callback/ { - rewrite ^/library/(.*)$ /direct_library/$1 last; + proxy_pass http://library.rightscale.local:8080/publishing_assistant/image_upload_callback/; + 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 /direct_library/ + location ~ ^/library/publishing_organizations/(.+)/image_upload_callback { - proxy_pass http://library.rightscale.local:3001/; + proxy_pass http://library.rightscale.local:8080/publishing_organizations/$1/image_upload_callback?$args; proxy_set_header X-Relative-Root library; proxy_set_header X-Embedded on; - proxy_set_header X-Core-Site-Domain right-site.rightscale.local; + proxy_set_header X-Core-Site-Domain 'right-site.rightscale.local'; } - location ~ ^/library/users/(.+)/openid_consume + # library static assets get proxied directly to the library app + location ~ ^/library/(.*)\.(css|js)$ { + proxy_pass http://library.rightscale.local:8080/$1.$2; + } + + # Library images are sent straight to the library + location /library_images/ { + proxy_pass http://library.rightscale.local:8080/library_images/; + } + + location /api/reporting/ { - proxy_pass http://library.rightscale.local:3001/users/$1/openid_consume?$args; + proxy_pass http://library.rightscale.local:8080/report_service_proxy/; proxy_set_header X-Relative-Root library; proxy_set_header X-Embedded on; + proxy_set_header X-Core-Site-Domain 'right-site.rightscale.local'; } + ##################################################################### + set $is_global_system_direct ""; - location ~ ^/library/(.*).(css|js) + # request is for a library related action + if ($request_uri ~ ^/global/) { - # library assets get proxied directly to the library app - proxy_pass http://library.rightscale.local:3001/$1.$2; + set $is_global_system_direct L; } + + # request is a POST + if ($request_method = POST) + { + set $is_global_system_direct "${is_global_system_direct}P"; + } + + # request is an AJAX + if ($http_x_requested_with = XMLHttpRequest) + { + set $is_global_system_direct "${is_global_system_direct}A"; + } - location /library_images/ + # library Post and Ajax request should be directly proxied + if ( $is_global_system_direct ~ (LP|LPA|LA) ) { - proxy_pass http://library.rightscale.local:3001/library_images/; + rewrite ^/global/(.*)$ /direct_global/$1 last; } + # provisioning routes to the library + if ($request_uri ~ ^/provisioning) + { + rewrite ^/provisioning(.*)$ /direct_global/provisioning$1 last; + } - location /library_rest/ + if ($request_uri ~ ^/aria_provisioning_callbacks) { - 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; + rewrite ^/aria_provisioning_callbacks(.*)$ /direct_global/aria_provisioning_callbacks$1 last; + } + + location /direct_global/ + { + proxy_pass http://global.rightscale.local:8080/; + proxy_set_header X-Embedded on; + proxy_set_header X-Relative-Root global/; + proxy_set_header X-Core-Site-Domain 'right-site.rightscale.local'; + } + + location /global_rest/ + { + proxy_pass http://global.rightscale.local:8080/; + proxy_set_header X-Relative-Root global/; + proxy_set_header X-Core-Site-Domain 'right-site.rightscale.local'; + } + + location ~ ^/global/users/(.+)/openid_consume + { + proxy_pass http://global.rightscale.local:8080/users/$1/openid_consume?$args; + proxy_set_header X-Relative-Root global; + proxy_set_header X-Embedded on; + proxy_set_header X-Core-Site-Domain 'right-site.rightscale.local'; } } server { ssi on; listen 3001;