[Kimchi-devel] [PATCH 1/2] Identify Kimchi variables from nginx config variables in nginx.conf.in file

Aline Manera alinefm at linux.vnet.ibm.com
Wed Sep 10 17:39:11 UTC 2014


Use {} around Kimchi variables in nginx.conf.in file so we can easily
identify which ones are placeholders and which ones is from nginx
config.
It also alllows us to append string after a Kimchi variable (ie,
${max_body_size}k)

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 src/nginx.conf.in | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/nginx.conf.in b/src/nginx.conf.in
index 1d1a398..9d11770 100644
--- a/src/nginx.conf.in
+++ b/src/nginx.conf.in
@@ -20,7 +20,7 @@
 # This is a template file to be used to generate a nginx
 # proxy config file at kimchid script.
 
-user  $user;
+user  ${user};
 worker_processes  1;
 
 error_log  /var/log/nginx/error.log;
@@ -46,10 +46,10 @@ http {
     send_timeout                600;
 
     server {
-        listen $proxy_ssl_port ssl;
+        listen ${proxy_ssl_port} ssl;
 
-        ssl_certificate $cert_pem;
-        ssl_certificate_key $cert_key;
+        ssl_certificate ${cert_pem};
+        ssl_certificate_key ${cert_key};
 
         add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
         add_header X-Frame-Options DENY;
@@ -57,16 +57,16 @@ http {
         add_header X-XSS-Protection "1; mode=block";
 
         location / {
-            proxy_pass http://127.0.0.1:$kimchid_port;
+            proxy_pass http://127.0.0.1:${kimchid_port};
             proxy_set_header Host $host;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-            proxy_redirect http://127.0.0.1:$kimchid_port/ https://$host:$proxy_ssl_port/;
+            proxy_redirect http://127.0.0.1:${kimchid_port}/ https://$host:${proxy_ssl_port}/;
         }
     }
 
     server {
-        listen $proxy_port;
-        rewrite ^/(.*)$ https://$host:$proxy_ssl_port/$1 redirect;
+        listen ${proxy_port};
+        rewrite ^/(.*)$ https://$host:${proxy_ssl_port}/$1 redirect;
     }
 }
-- 
1.9.3




More information about the Kimchi-devel mailing list