From 3114b09901bc12c7f2c74cbfaffdd7eee790e78a Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Wed, 15 Oct 2014 16:09:56 +0200 Subject: [PATCH] MT#9597 nginx template: add ssl extended options Change-Id: I88ba237f135d8194c07ef1c6d3938040e64dd41a --- etc/nginx.site | 65 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/etc/nginx.site b/etc/nginx.site index f4a781b..5454825 100644 --- a/etc/nginx.site +++ b/etc/nginx.site @@ -1,6 +1,6 @@ [% TAGS [- -] -%] -[% IF www_csc.apache.port != 80 && www_admin.apache.port != 80 && ossbss.apache.port != 80 %] +[% IF www_csc.apache.port != 80 && www_admin.apache.port != 80 && ossbss.apache.port != 80 -%] server { listen [::]:80 ipv6only=off; @@ -12,37 +12,38 @@ server { return 301 https://$host:[% www_csc.apache.port %]$request_uri; } } -[% END %] +[% END -%] server { - listen [::]:[% www_csc.apache.port %] ipv6only=off; - [% IF www_csc.apache.ssl_enable == "yes" %] - ssl on; - ssl_certificate [% www_csc.apache.sslcertfile %]; - ssl_certificate_key [% www_csc.apache.sslcertkeyfile %]; - [% END %] - server_name [% www_csc.apache.servername %]; - - location /favicon.ico { - alias /usr/share/ngcp-www-csc/lib/csc/root/favicon.ico; - } - - location /(css|grafik|js) { - root /usr/share/ngcp-www-csc/lib/csc/root; - } - - location / { - include /etc/nginx/fastcgi_params; - # Catalyst requires setting PATH_INFO (instead of SCRIPT_NAME) to $fastcgi_script_name - fastcgi_param SCRIPT_NAME ''; - fastcgi_param PATH_INFO $fastcgi_script_name; - fastcgi_param HTTPS on; - # TODO: configs for fastcgi process - fastcgi_pass unix:/var/run/fastcgi/ngcp-www-csc.sock; - } -[% IF www_csc.apache.port == 80 %] - location /handbook { - return 301 http://$host:[% www_admin.apache.port %]$request_uri; - } -[% END %] + listen [::]:[% www_csc.apache.port %] ipv6only=off; + [% IF www_csc.apache.ssl_enable == "yes" -%] + ssl_certificate [% www_csc.apache.sslcertfile %]; + ssl_certificate_key [% www_csc.apache.sslcertkeyfile %]; + include /etc/nginx/ssl_params; + [% END -%] + server_name [% www_csc.apache.servername %]; + + location /favicon.ico { + alias /usr/share/ngcp-www-csc/lib/csc/root/favicon.ico; + } + + location /(css|grafik|js) { + root /usr/share/ngcp-www-csc/lib/csc/root; + } + + location / { + include /etc/nginx/fastcgi_params; + # Catalyst requires setting PATH_INFO (instead of SCRIPT_NAME) to $fastcgi_script_name + fastcgi_param SCRIPT_NAME ''; + fastcgi_param PATH_INFO $fastcgi_script_name; + fastcgi_param HTTPS on; + # TODO: configs for fastcgi process + fastcgi_pass unix:/var/run/fastcgi/ngcp-www-csc.sock; + } +[% IF www_csc.apache.port == 80 -%] + + location /handbook { + return 301 http://$host:[% www_admin.apache.port %]$request_uri; + } +[% END -%] }