generators/vulcanize/templates/nginx/config/rubber/role/web_tools/nginx-tools.conf in sml-rubber-0.9.9 vs generators/vulcanize/templates/nginx/config/rubber/role/web_tools/nginx-tools.conf in sml-rubber-0.9.10

- old
+ new

@@ -1,74 +1,55 @@ <% - @path = "/etc/nginx/nginx.conf" - - also_web = rubber_instances[rubber_env.host].role_names.include?('web') rescue false - # Only want to be additive if we are running web server on same host as tools - if also_web - @additive = ["# rubber-web_tools-start", "# rubber-web_tools-end"] - end + @path = "/etc/nginx/rubber/tools.conf" %> -<%# only need this section if running without nginx configured for site %> -<% if ! also_web %> - user www-data; - worker_processes 1; - - error_log /var/log/nginx/error.log; - pid /var/run/nginx.pid; - - events - { - worker_connections 1024; - } - -<% end %> +# This server is setup to serve http. +server +{ + listen <%= rubber_env.web_tools_port %>; + server_name <%= rubber_env.full_host %>; + root /var/www; -http + rewrite (.*) https://$host:<%= rubber_env.web_tools_ssl_port %>$1 break; +} + +# This server is setup to serve https. +server { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - access_log /var/log/nginx/access.log; - - sendfile on; - - keepalive_timeout 65; - tcp_nodelay on; - - gzip on; + listen <%= rubber_env.web_tools_ssl_port %>; + server_name <%= rubber_env.full_host %>; - # This server is setup to serve www. - server + ssl on; + ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; + ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; + # ssl_certificate <%= RUBBER_ROOT %>/config/snapmylife.com.crt; + # ssl_certificate_key <%= RUBBER_ROOT %>/config/snapmylife.com.key; + + auth_basic "Rubber Admin Tools"; + auth_basic_user_file <%= RUBBER_ROOT %>/config/<%= rubber_env.app_name %>.auth; + + client_max_body_size 10M; + root /var/www; + + + location / { - listen <%= rubber_env.web_tools_port %>; - client_max_body_size 10M; - - server_name <%= rubber_env.full_host %>; - - root /var/www; - - - location / + # If the file exists as a static file serve it directly without + # running all the other rewrite tests on it + if (-f $request_filename) { - # If the file exists as a static file serve it directly without - # running all the other rewrite tests on it - if (-f $request_filename) - { - break; - } - - # check for index.html for directory index - # if its there on the filesystem then rewite - # the url to add /index.html to the end of it - # and then break to send it to the next config rules. - if (-f $request_filename/index.html) - { - rewrite (.*) $1/index.html break; - } + break; } - - include /etc/nginx/rubber/*.conf; + + # check for index.html for directory index + # if its there on the filesystem then rewite + # the url to add /index.html to the end of it + # and then break to send it to the next config rules. + if (-f $request_filename/index.html) + { + rewrite (.*) $1/index.html break; + } } - + + include /etc/nginx/rubber/tools/*.conf; }