Changeset a8965fb for src


Ignore:
Timestamp:
Feb 7, 2021, 2:18:12 PM (6 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
25a7f74
Parents:
e6aa6a3
Message:
  • Added proxy rules for osm_tiles
  • Added rewrite rules for mapservice-webclient
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/puppetcode/environments/gnuboat/modules/gnuboat_mapservice/manifests/apache_config.pp

    re6aa6a3 ra8965fb  
    11class gnuboat_mapservice::apache_config inherits gnuboat_mapservice
    22{
    3         # Configure apache, if wanted
    4         if($apache_enabled){
    5                 if empty($apache_vhost_ssl_cert) and empty($apache_vhost_ssl_key) {
    6                         apache::vhost{$apache_vhost_name:
    7                                 servername => $apache_vhost_servername,
    8                                 port => '80',
    9                                 docroot => '/var/www',
    10                                 proxy_pass => [
    11                                         { path => '/', url => 'http://localhost:8080/' },
    12                                 ],
    13                                 suphp_engine => off,
    14                         }
    15                 } else {
    16                         apache::vhost{$apache_vhost_name:
    17                                 servername => $apache_vhost_servername,
    18                                 port => '443',
    19                                 docroot => '/var/www',
    20                                 proxy_pass => [
    21                                         { path => '/', url => 'http://localhost:8080/' },
    22                                 ],
    23                                 suphp_engine => off,
    24                                 ssl => true,
    25                                 ssl_cert => $apache_vhost_ssl_cert,
    26                                 ssl_key => $apache_vhost_ssl_key,
    27                         }
    28                 }
     3    # Configure apache, if wanted
     4    if($apache_enabled){
     5        # install and enable mod rewrite
     6        apache::mod { 'rewrite': }
     7        if empty($apache_vhost_ssl_cert) and empty($apache_vhost_ssl_key) {
     8            apache::vhost{$apache_vhost_name:
     9                servername => $apache_vhost_servername,
     10                port => '80',
     11                docroot => '/var/www/gnuboat_mapservice_webclient',
     12                proxy_pass => [
     13                    { path => '/mapservice', url => 'http://localhost:8080/mapservice' },
     14                    { path => '/osm_tiles', url => 'http://localhost:8081/' },
     15                ],
     16                rewrites => [
     17                    {
     18                        rewrite_base =>  '/',
     19                        rewrite_cond => ['%{THE_REQUEST} !\s/+(mapservice|osm_tiles)/ [NC]'],
     20                        rewrite_cond => ['%{REQUEST_FILENAME} !-d'],
     21                        rewrite_cond => ['%{REQUEST_FILENAME} !-f'],
     22                        rewrite_cond => ['%{THE_REQUEST} !^/resources/(.+)$'],
     23                        rewrite_rule => ['^(.+)$ index.html?path=$1 [L]'],
     24                    },
     25                ]
     26                suphp_engine => off,
     27            }
     28        } else {
     29            apache::vhost{$apache_vhost_name:
     30                servername => $apache_vhost_servername,
     31                port => '443',
     32                docroot => '/var/www/gnuboat_mapservice_webclient',
     33                proxy_pass => [
     34                    { path => '/mapservice', url => 'http://localhost:8080/mapservice' },
     35                    { path => '/osm_tiles', url => 'http://localhost:8081/' },
     36                ],
     37                rewrites => [
     38                    {
     39                        rewrite_base =>  '/',
     40                        rewrite_cond => ['%{THE_REQUEST} !\s/+(mapservice|osm_tiles)/ [NC]'],
     41                        rewrite_cond => ['%{REQUEST_FILENAME} !-d'],
     42                        rewrite_cond => ['%{REQUEST_FILENAME} !-f'],
     43                        rewrite_cond => ['%{THE_REQUEST} !^/resources/(.+)$'],
     44                        rewrite_rule => ['^(.+)$ index.html?path=$1 [L]'],
     45                    },
     46                ]
     47                suphp_engine => off,
     48                ssl => true,
     49                ssl_cert => $apache_vhost_ssl_cert,
     50                ssl_key => $apache_vhost_ssl_key,
     51            }
     52        }
    2953
    30                 if($apache_replace_default_host){
    31                         class {'apache': default_vhost => false,
    32                         }
    33                 }
     54        if($apache_replace_default_host){
     55            class {'apache': default_vhost => false,
     56            }
    3457        }
     58    }
    3559}
Note: See TracChangeset for help on using the changeset viewer.