Commits

Éric Veiras Galisson  committed b45dfed

nginx: fixing site definitions, default site behaviour

  • Participants
  • Parent commits 1340336

Comments (0)

Files changed (4)

File nginx/manifests/site/proxy.pp

 
     include nginx::package
 
-    $define_servername = $default_vhost ?{
-        true    => "$server_name default",
-        default => $server_name,
+    $define_port = $default_vhost ?{
+        true    => "$port default",
+        default => $port,
     }
     $src_filename = "/etc/nginx/sites-available/${name}"
     $dst_filename = "/etc/nginx/sites-enabled/${name}"

File nginx/manifests/site/redirect.pp

 
     include nginx::package
 
-    $define_servername = $default_vhost ?{
-        true    => "$server_name default",
-        default => $server_name,
+    $define_port = $default_vhost ?{
+        true    => "$port default",
+        default => $port,
     }
     $define_permanent = $permanent ?{
         false   => "",

File nginx/templates/proxy.erb

     server      <%= upstream %> fail_timeout=0;
 }
 
-server {
-    listen      80;
-    server_name <%= define_servername %><% server_aliases.each do |val| -%> <%= val %><% end -%>;
+server {        
+    listen      <%= define_port %>;
+    server_name <%= server_name %><% server_aliases.each do |val| -%> <%= val %><% end -%>;
 
     access_log          /var/log/nginx/<%= define_servername %>.access.log;
     error_log           /var/log/nginx/<%= define_servername %>.error.log;

File nginx/templates/redirect.erb

 # module nginx
 
 server {
-    listen <%= port %>;
-    server_name <%= define_servername %><% server_aliases.each do |val| -%> <%= val %><% end -%>;
+    listen <%= define_port %>;
+    server_name <%= server_name %><% server_aliases.each do |val| -%> <%= val %><% end -%>;
     rewrite ^(.*)$ <%= redirect_url %>$1 <%= define_permanent %>;
 }