update 22222 ssl configuration
This commit is contained in:
@@ -442,6 +442,14 @@ class WOStackController(CementBaseController):
|
||||
os.makedirs('{0}22222/cert'
|
||||
.format(WOVariables.wo_webroot))
|
||||
|
||||
if not os.path.exists('{0}22222/conf/nginx'
|
||||
.format(WOVariables.wo_webroot)):
|
||||
Log.debug(self, "Creating directory "
|
||||
"{0}22222/conf/nginx"
|
||||
.format(WOVariables.wo_webroot))
|
||||
os.makedirs('{0}22222/conf/nginx'
|
||||
.format(WOVariables.wo_webroot))
|
||||
|
||||
WOFileUtils.create_symlink(self, ['/var/log/nginx/'
|
||||
'22222.access.log',
|
||||
'{0}22222/'
|
||||
@@ -491,6 +499,15 @@ class WOStackController(CementBaseController):
|
||||
self, "Failed to generate HTTPS "
|
||||
"certificate for 22222")
|
||||
|
||||
if not os.path.isfile('{0}22222/conf/nginx/ssl.conf'
|
||||
.format(WOVariables.wo_webroot)):
|
||||
with open("/etc/nginx/conf.d/"
|
||||
"upstream.conf", "a") as php_file:
|
||||
php_file.write("ssl_certificate "
|
||||
"/var/www/22222/cert/22222.crt;\n"
|
||||
"ssl_certificate_key "
|
||||
"/var/www/22222/cert/22222.key;\n")
|
||||
|
||||
# Nginx Configation into GIT
|
||||
WOGit.add(self,
|
||||
["/etc/nginx"], msg="Adding Nginx into Git")
|
||||
|
||||
@@ -7,9 +7,6 @@ server {
|
||||
access_log /var/log/nginx/22222.access.log rt_cache;
|
||||
error_log /var/log/nginx/22222.error.log;
|
||||
|
||||
ssl_certificate {{webroot}}22222/cert/22222.crt;
|
||||
ssl_certificate_key {{webroot}}22222/cert/22222.key;
|
||||
|
||||
# Force HTTP to HTTPS
|
||||
error_page 497 =200 https://$host:22222$request_uri;
|
||||
|
||||
@@ -65,9 +62,8 @@ server {
|
||||
proxy_store off;
|
||||
proxy_pass http://netdata/$ndpath$is_args$args;
|
||||
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
gzip_types *;
|
||||
}
|
||||
|
||||
include {{webroot}}22222/conf/nginx/*.conf;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user