Skip to content

Commit 2b408b7

Browse files
author
Till Brehm
committed
Merge branch 'nginx_ssl_apps' into 'develop'
consistent apps vhost templates See merge request ispconfig/ispconfig3!1205
2 parents 5f67c8b + 81743c0 commit 2b408b7

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

install/lib/installer_base.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2553,7 +2553,7 @@ public function configure_apps_vhost() {
25532553
}
25542554

25552555
// comment out the listen directive if port is 80 or 443
2556-
if($conf['web']['apps_vhost_ip'] == 80 or $conf['web']['apps_vhost_ip'] == 443) {
2556+
if($conf['web']['apps_vhost_port'] == 80 or $conf['web']['apps_vhost_port'] == 443) {
25572557
$tpl->setVar('vhost_port_listen','#');
25582558
} else {
25592559
$tpl->setVar('vhost_port_listen','');

install/tpl/apache_apps.vhost.master

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,9 @@
122122
{/tmpl_if}
123123

124124
</VirtualHost>
125+
126+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
127+
<IfModule mod_ssl.c>
128+
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
129+
</IfModule>
130+
</tmpl_if>

install/tpl/nginx_apps.vhost.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
server {
2-
listen {apps_vhost_port} {ssl_on};
2+
listen {apps_vhost_ip}{apps_vhost_port} {ssl_on};
33
listen [::]:{apps_vhost_port} {ssl_on} ipv6only=on;
44

55
{ssl_comment}ssl_protocols TLSv1.2;
@@ -99,7 +99,7 @@ server {
9999
fastcgi_param REDIRECT_STATUS 200;
100100
# To access phpMyAdmin, the default user (like www-data on Debian/Ubuntu) must be used
101101
{use_tcp}fastcgi_pass 127.0.0.1:9000;
102-
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
102+
{use_socket}fastcgi_pass unix:{fpm_socket};
103103
fastcgi_index index.php;
104104
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
105105
fastcgi_buffer_size 128k;
@@ -149,7 +149,7 @@ server {
149149
fastcgi_param REDIRECT_STATUS 200;
150150
# To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
151151
{use_tcp}fastcgi_pass 127.0.0.1:9000;
152-
{use_socket}fastcgi_pass unix:/var/run/php5-fpm.sock;
152+
{use_socket}fastcgi_pass unix:{fpm_socket};
153153
fastcgi_index index.php;
154154
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
155155
fastcgi_buffer_size 128k;

server/conf/nginx_apps.vhost.master

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
server {
2-
listen {apps_vhost_ip}{apps_vhost_port};
2+
listen {apps_vhost_ip}{apps_vhost_port} {ssl_on};
3+
listen [::]:{apps_vhost_port} {ssl_on} ipv6only=on;
4+
5+
{ssl_comment}ssl_protocols TLSv1.2;
6+
{ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
7+
{ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key;
8+
9+
# redirect to https if accessed with http
10+
{ssl_comment}error_page 497 https://$host:{vhost_port}$request_uri;
311

412
server_name {apps_vhost_servername};
513

@@ -12,7 +20,7 @@ server {
1220
}
1321

1422
# serve static files directly
15-
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
23+
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
1624
access_log off;
1725
}
1826

@@ -165,6 +173,7 @@ server {
165173
fastcgi_param CONTENT_TYPE $content_type;
166174
fastcgi_param CONTENT_LENGTH $content_length;
167175

176+
fastcgi_param SCRIPT_FILENAME $request_filename;
168177
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
169178
fastcgi_param REQUEST_URI $request_uri;
170179
fastcgi_param DOCUMENT_URI $document_uri;
@@ -223,5 +232,4 @@ server {
223232
{use_rspamd}alias /usr/share/rspamd/www/$1;
224233
{use_rspamd}}
225234
{use_rspamd}}
226-
227235
}

0 commit comments

Comments
 (0)