update 22222 ssl configuration

This commit is contained in:
VirtuBox
2019-04-12 02:43:41 +02:00
parent b8fbf44b61
commit 1686775f60
3 changed files with 22 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
<p align="center"><img src="https://docs.wordops.net/images/logo.png" width="400" alt="Wordops" /><a href="https://wordops.net"> <p align="center"><img src="https://raw.githubusercontent.com/WordOps/WordOps/updating-configuration/logo.png" width="400" alt="Wordops" /><a href="https://wordops.net">
<br> <br>
</p> </p>
@@ -140,8 +140,8 @@ wo update
## Support ## Support
If you feel there is a bug directly related to WordOps, feel free to open an issue. If you feel there is a bug directly related to WordOps, or if you want to suggest new features for WordOps, feel free to open an issue.
For any other questions/suggestions about WordOps or if you need support, please use the [WordOps Community Forum](https://community.wordops.net/). For any other questions about WordOps or if you need support, please use the [Community Forum](https://community.wordops.net/).
# Contributing # Contributing

View File

@@ -442,6 +442,14 @@ class WOStackController(CementBaseController):
os.makedirs('{0}22222/cert' os.makedirs('{0}22222/cert'
.format(WOVariables.wo_webroot)) .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/' WOFileUtils.create_symlink(self, ['/var/log/nginx/'
'22222.access.log', '22222.access.log',
'{0}22222/' '{0}22222/'
@@ -491,6 +499,15 @@ class WOStackController(CementBaseController):
self, "Failed to generate HTTPS " self, "Failed to generate HTTPS "
"certificate for 22222") "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 # Nginx Configation into GIT
WOGit.add(self, WOGit.add(self,
["/etc/nginx"], msg="Adding Nginx into Git") ["/etc/nginx"], msg="Adding Nginx into Git")

View File

@@ -7,9 +7,6 @@ server {
access_log /var/log/nginx/22222.access.log rt_cache; access_log /var/log/nginx/22222.access.log rt_cache;
error_log /var/log/nginx/22222.error.log; 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 # Force HTTP to HTTPS
error_page 497 =200 https://$host:22222$request_uri; error_page 497 =200 https://$host:22222$request_uri;
@@ -65,9 +62,8 @@ server {
proxy_store off; proxy_store off;
proxy_pass http://netdata/$ndpath$is_args$args; proxy_pass http://netdata/$ndpath$is_args$args;
gzip on;
gzip_proxied any;
gzip_types *;
} }
include {{webroot}}22222/conf/nginx/*.conf;
} }