Browse Source

EasyEngine optimized configuration added

feature/refactor-php
harshadyeola 9 years ago
parent
commit
afff3d423f
  1. 7
      ee/cli/plugins/site_functions.py
  2. 20
      ee/cli/plugins/stack.py
  3. 86
      ee/cli/templates/ee-plus.mustache

7
ee/cli/plugins/site_functions.py

@ -661,10 +661,11 @@ def site_package_check(self, stype):
if EEAptGet.is_installed(self, 'nginx-plus'):
# do something
# do post nginx installation configuration
apt_packages = ["nginx-plus"]
print("NGINX-PLUS detected ...")
apt = ["nginx-plus"] + EEVariables.ee_nginx
packages = []
apt_packages = apt_packages + EEVariables.ee_nginx
stack.post_pref(apt_packages , packages)
#apt_packages = apt_packages + EEVariables.ee_nginx
stack.post_pref(apt, packages)
else:
apt_packages = apt_packages + EEVariables.ee_nginx

20
ee/cli/plugins/stack.py

@ -442,7 +442,25 @@ class EEStackController(CementBaseController):
EEGit.add(self,
["/etc/nginx"], msg="Adding Nginx into Git")
EEService.reload_service(self, 'nginx')
self.msg = (self.msg + ["HTTP Auth User Name: easyengine"]
if set(["nginx-plus"]).issubset(set(apt_packages)):
EEShellExec.cmd_exec(self, "sed -i -e 's/^user/#user/'"
" -e '/^#user/a user"
"\ www-data\;'"
" /etc/nginx/nginx.conf")
# EasyEngine config for NGINX plus
Log.debug(self, 'Writting for nginx plus configuration'
' to file /etc/nginx/conf.d/ee-plus.conf')
ee_nginx = open('/etc/nginx/conf.d/ee-plus.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'ee-plus.mustache',
out=ee_nginx)
ee_nginx.close()
print("HTTP Auth User Name: easyengine"
+ "\nHTTP Auth Password : {0}".format(passwd))
else:
self.msg = (self.msg + ["HTTP Auth User Name: easyengine"]
+ ["HTTP Auth Password : {0}".format(passwd)])
if EEAptGet.is_installed(self,'redis-server'):

86
ee/cli/templates/ee-plus.mustache

@ -0,0 +1,86 @@
##
# EasyEngine Settings
##
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
server_tokens off;
reset_timedout_connection on;
add_header X-Powered-By "EasyEngine 3.3.5";
add_header rt-Fastcgi-Cache $upstream_cache_status;
# Limit Request
limit_req_status 403;
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
# Proxy Settings
# set_real_ip_from proxy-server-ip;
# real_ip_header X-Forwarded-For;
fastcgi_read_timeout 300;
client_max_body_size 100m;
##
# SSL Settings
##
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!MD5:!kEDH;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
##
# Basic Settings
##
server_names_hash_bucket_size 16384;
# server_name_in_redirect off;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Log format Settings
log_format rt_cache '$remote_addr $upstream_response_time $upstream_cache_status [$time_local] '
'$http_host "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$request_body"';
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component
text/xml
text/javascript;
include /etc/nginx/sites-enabled/*;
Loading…
Cancel
Save