diff options
Diffstat (limited to 'server/etc')
-rw-r--r-- | server/etc/apache-prev2.4.conf.tmpl | 13 | ||||
-rw-r--r-- | server/etc/apache.conf.tmpl | 11 |
2 files changed, 21 insertions, 3 deletions
diff --git a/server/etc/apache-prev2.4.conf.tmpl b/server/etc/apache-prev2.4.conf.tmpl index db782843..170b1359 100644 --- a/server/etc/apache-prev2.4.conf.tmpl +++ b/server/etc/apache-prev2.4.conf.tmpl @@ -2,13 +2,24 @@ Alias /opengnsys CONSOLEDIR +RewriteEngine On + # Overrides default CentOS php.ini configuration. php_value short_open_tag on +# Redirect HTTP to HTTPS and default configuration. <Directory CONSOLEDIR> + RewriteCond %{HTTPS} !=on + RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R] Options -Indexes FollowSymLinks DirectoryIndex index.php + AddType octet/stream .pkg </Directory> +# Redirect HTTP to HTTPS and RESTful configuration. <Directory CONSOLEDIR/rest> - AllowOverride All + RewriteBase /opengnsys/rest/ + RewriteCond %{HTTPS} !=on + RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [QSA,L] </Directory> diff --git a/server/etc/apache.conf.tmpl b/server/etc/apache.conf.tmpl index 8c978fd3..5249d3fc 100644 --- a/server/etc/apache.conf.tmpl +++ b/server/etc/apache.conf.tmpl @@ -2,19 +2,26 @@ Alias /opengnsys CONSOLEDIR +RewriteEngine On + # Overrides default CentOS php.ini configuration. php_value short_open_tag on +# Redirect HTTP to HTTPS and default configuration. <Directory CONSOLEDIR> + RewriteCond %{HTTPS} !=on + RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R] Require all granted Options -Indexes +FollowSymLinks DirectoryIndex index.php + AddType octet/stream .pkg </Directory> -# RESTful configuration. +# Redirect HTTP to HTTPS and RESTful configuration. <Directory CONSOLEDIR/rest> - RewriteEngine On RewriteBase /opengnsys/rest/ + RewriteCond %{HTTPS} !=on + RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L] </Directory> |