Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
provision
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
provision
Commits
a19e495d
Commit
a19e495d
authored
May 19, 2016
by
omega8cc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nginx: Add HTTP/2 support detection
parent
5db99930
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
0 deletions
+30
-0
http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
+9
-0
http/Provision/Config/Nginx/server.tpl.php
http/Provision/Config/Nginx/server.tpl.php
+5
-0
http/Provision/Config/Nginx/subdir.tpl.php
http/Provision/Config/Nginx/subdir.tpl.php
+10
-0
http/Provision/Service/http/nginx.php
http/Provision/Service/http/nginx.php
+3
-0
http/Provision/Service/http/nginx/ssl.php
http/Provision/Service/http/nginx/ssl.php
+3
-0
No files found.
http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
View file @
a19e495d
...
...
@@ -3,18 +3,27 @@ $nginx_config_mode = drush_get_option('nginx_config_mode');
if
(
!
$nginx_config_mode
&&
$server
->
nginx_config_mode
)
{
$nginx_config_mode
=
$server
->
nginx_config_mode
;
}
$phpfpm_mode
=
drush_get_option
(
'phpfpm_mode'
);
if
(
!
$phpfpm_mode
&&
$server
->
phpfpm_mode
)
{
$phpfpm_mode
=
$server
->
phpfpm_mode
;
}
$nginx_is_modern
=
drush_get_option
(
'nginx_is_modern'
);
if
(
!
$nginx_is_modern
&&
$server
->
nginx_is_modern
)
{
$nginx_is_modern
=
$server
->
nginx_is_modern
;
}
$nginx_has_http2
=
drush_get_option
(
'nginx_has_http2'
);
if
(
!
$nginx_has_http2
&&
$server
->
nginx_has_http2
)
{
$nginx_has_http2
=
$server
->
nginx_has_http2
;
}
$nginx_has_upload_progress
=
drush_get_option
(
'nginx_has_upload_progress'
);
if
(
!
$nginx_has_upload_progress
&&
$server
->
nginx_has_upload_progress
)
{
$nginx_has_upload_progress
=
$server
->
nginx_has_upload_progress
;
}
$satellite_mode
=
drush_get_option
(
'satellite_mode'
);
if
(
!
$satellite_mode
&&
$server
->
satellite_mode
)
{
$satellite_mode
=
$server
->
satellite_mode
;
...
...
http/Provision/Config/Nginx/server.tpl.php
View file @
a19e495d
...
...
@@ -15,6 +15,11 @@ if (!$nginx_is_modern && $server->nginx_is_modern) {
$nginx_is_modern
=
$server
->
nginx_is_modern
;
}
$nginx_has_http2
=
drush_get_option
(
'nginx_has_http2'
);
if
(
!
$nginx_has_http2
&&
$server
->
nginx_has_http2
)
{
$nginx_has_http2
=
$server
->
nginx_has_http2
;
}
$nginx_has_gzip
=
drush_get_option
(
'nginx_has_gzip'
);
if
(
!
$nginx_has_gzip
&&
$server
->
nginx_has_gzip
)
{
$nginx_has_gzip
=
$server
->
nginx_has_gzip
;
...
...
http/Provision/Config/Nginx/subdir.tpl.php
View file @
a19e495d
...
...
@@ -3,22 +3,32 @@ $nginx_config_mode = drush_get_option('nginx_config_mode');
if
(
!
$nginx_config_mode
&&
$server
->
nginx_config_mode
)
{
$nginx_config_mode
=
$server
->
nginx_config_mode
;
}
$phpfpm_mode
=
drush_get_option
(
'phpfpm_mode'
);
if
(
!
$phpfpm_mode
&&
$server
->
phpfpm_mode
)
{
$phpfpm_mode
=
$server
->
phpfpm_mode
;
}
$nginx_is_modern
=
drush_get_option
(
'nginx_is_modern'
);
if
(
!
$nginx_is_modern
&&
$server
->
nginx_is_modern
)
{
$nginx_is_modern
=
$server
->
nginx_is_modern
;
}
$nginx_has_http2
=
drush_get_option
(
'nginx_has_http2'
);
if
(
!
$nginx_has_http2
&&
$server
->
nginx_has_http2
)
{
$nginx_has_http2
=
$server
->
nginx_has_http2
;
}
$nginx_has_upload_progress
=
drush_get_option
(
'nginx_has_upload_progress'
);
if
(
!
$nginx_has_upload_progress
&&
$server
->
nginx_has_upload_progress
)
{
$nginx_has_upload_progress
=
$server
->
nginx_has_upload_progress
;
}
$satellite_mode
=
drush_get_option
(
'satellite_mode'
);
if
(
!
$satellite_mode
&&
$server
->
satellite_mode
)
{
$satellite_mode
=
$server
->
satellite_mode
;
}
$subdir_loc
=
str_replace
(
'/'
,
'_'
,
$subdir
);
$subdir_dot
=
str_replace
(
'/'
,
'.'
,
$subdir
);
?>
...
...
http/Provision/Service/http/nginx.php
View file @
a19e495d
...
...
@@ -19,6 +19,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
$this
->
configs
[
'site'
][]
=
'Provision_Config_Nginx_Site'
;
$this
->
server
->
setProperty
(
'nginx_config_mode'
,
'extended'
);
$this
->
server
->
setProperty
(
'nginx_is_modern'
,
FALSE
);
$this
->
server
->
setProperty
(
'nginx_has_http2'
,
FALSE
);
$this
->
server
->
setProperty
(
'nginx_has_gzip'
,
FALSE
);
$this
->
server
->
setProperty
(
'nginx_has_upload_progress'
,
FALSE
);
$this
->
server
->
setProperty
(
'provision_db_cloaking'
,
TRUE
);
...
...
@@ -54,6 +55,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
// Check if some nginx features are supported and save them for later.
$this
->
server
->
shell_exec
(
$path
.
' -V'
);
$this
->
server
->
nginx_is_modern
=
preg_match
(
"/nginx\/1\.((1\.(8|9|(1[0-9]+)))|((2|3|4|5|6|7|8|9|[1-9][0-9]+)\.))/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_http2
=
preg_match
(
"/http_v2_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_upload_progress
=
preg_match
(
"/upload/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_gzip
=
preg_match
(
"/http_gzip_static_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
...
...
@@ -115,6 +117,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
// Check if some nginx features are supported and save them for later.
$this
->
server
->
shell_exec
(
$path
.
' -V'
);
$this
->
server
->
nginx_is_modern
=
preg_match
(
"/nginx\/1\.((1\.(8|9|(1[0-9]+)))|((2|3|4|5|6|7|8|9|[1-9][0-9]+)\.))/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_http2
=
preg_match
(
"/http_v2_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_upload_progress
=
preg_match
(
"/upload/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_gzip
=
preg_match
(
"/http_gzip_static_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
...
...
http/Provision/Service/http/nginx/ssl.php
View file @
a19e495d
...
...
@@ -39,6 +39,7 @@ class Provision_Service_http_nginx_ssl extends Provision_Service_http_ssl {
$this
->
configs
[
'site'
][]
=
'Provision_Config_Nginx_Ssl_Site'
;
$this
->
server
->
setProperty
(
'nginx_config_mode'
,
'extended'
);
$this
->
server
->
setProperty
(
'nginx_is_modern'
,
FALSE
);
$this
->
server
->
setProperty
(
'nginx_has_http2'
,
FALSE
);
$this
->
server
->
setProperty
(
'nginx_has_gzip'
,
FALSE
);
$this
->
server
->
setProperty
(
'nginx_has_upload_progress'
,
FALSE
);
$this
->
server
->
setProperty
(
'provision_db_cloaking'
,
TRUE
);
...
...
@@ -63,6 +64,7 @@ class Provision_Service_http_nginx_ssl extends Provision_Service_http_ssl {
// Check if some nginx features are supported and save them for later.
$this
->
server
->
shell_exec
(
$path
.
' -V'
);
$this
->
server
->
nginx_is_modern
=
preg_match
(
"/nginx\/1\.((1\.(8|9|(1[0-9]+)))|((2|3|4|5|6|7|8|9|[1-9][0-9]+)\.))/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_http2
=
preg_match
(
"/http_v2_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_upload_progress
=
preg_match
(
"/upload/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_gzip
=
preg_match
(
"/http_gzip_static_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
...
...
@@ -115,6 +117,7 @@ class Provision_Service_http_nginx_ssl extends Provision_Service_http_ssl {
// Check if some nginx features are supported and save them for later.
$this
->
server
->
shell_exec
(
$path
.
' -V'
);
$this
->
server
->
nginx_is_modern
=
preg_match
(
"/nginx\/1\.((1\.(8|9|(1[0-9]+)))|((2|3|4|5|6|7|8|9|[1-9][0-9]+)\.))/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_http2
=
preg_match
(
"/http_v2_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_upload_progress
=
preg_match
(
"/upload/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
$this
->
server
->
nginx_has_gzip
=
preg_match
(
"/http_gzip_static_module/"
,
implode
(
''
,
drush_shell_exec_output
()),
$match
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment