Permalink
Browse files

added config

  • Loading branch information...
1 parent ce26f7e commit cb07d5018de65585b59bea4f395b83f9bd9e8d0a @edwardt committed Apr 5, 2011
Showing with 7 additions and 15 deletions.
  1. +5 −5 lib/appserver/appserver.conf.rb
  2. +2 −10 lib/appserver/nginx.rb
@@ -15,11 +15,11 @@
#monit_reload '/usr/sbin/monit reload'
# Path/name of the Nginx configuration snippet that should be written
-#nginx_conf 'nginx.conf'
+nginx_conf '/etc/nginx/nginx.conf'
# Command to execute to tell Nginx to reload the configuration. Used within
# the Monit snippet, so this command will be called as root
-#nginx_reload '/usr/sbin/nginx -s reload'
+nginx_reload '/usr/sbin/nginx -s reload'
# Command to execute to tell Nginx to reopen the log files. Used within
# the Logrotate snippet, so this command will be called as root
@@ -45,7 +45,7 @@
# RVM, you can use "/usr/local/bin/rvm XYZ ruby" here to easily use
# different Ruby versions for different applications. Make sure the
# targetted Ruby version also has the appserver gem installed!
-#ruby '/usr/bin/ruby'
+ruby '/usr/bin/ruby'
# Rack environment to run the application in. Defaults to 'production'
#environment 'production'
@@ -100,7 +100,7 @@
# tells Nginx, which requests to route to the application and therefore
# makes it possible to run multiple domains on a single IP address. The
# domain setting defaults to the system's domainname
-#domain 'example.com'
+domain 'example.com'
# If a SSL certificate and key are set, Nginx will be configured to accept
# HTTPS connections as well. The default is to only accept HTTP
@@ -109,7 +109,7 @@
# Path where public static files should be served from by Nginx. Defaults to
# the public directory in the application
-#public_dir 'public'
+public_dir 'public'
#
View
@@ -44,18 +44,10 @@ def write_server_definition (f, app, ssl = false)
f.puts " listen #{ssl ? 443 : 80};"
f.puts " server_name #{app.hostname};"
write_config_for_ssl(ssl, f, app)
- #f.puts " root #{app.public_path};"
f.puts " access_log #{app.access_log};"
- # f.puts " try_files $uri/index.html $uri.html $uri @#{app.name};"
- f.puts " location @#{app.name} {"
- f.puts " proxy_set_header X-Real-IP $remote_addr;"
- f.puts " proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
- f.puts " proxy_set_header X-Forwarded-Proto https;" if ssl
- f.puts " proxy_set_header Host $http_host;"
- f.puts " proxy_redirect off;"
- f.puts " proxy_pass http://#{app.targethostname}:#{app.targetport};"
+ f.puts " location /{"
+ f.puts " rewrite ^ http://#{app:targethostname}:#{app:targetport}/$request_uri;"
f.puts " }"
- #f.puts " error_page 500 502 503 504 /500.html;" if File.exist?(File.join(app.public_path, '500.html'))
f.puts "}"
end

0 comments on commit cb07d50

Please sign in to comment.