diff --git a/manifests/nginx.pp b/manifests/nginx.pp index cad729559567dcd5a7062203842e24e4aab5c823..fbb75fe87fd43d3178b80266059dbee03dfe8845 100644 --- a/manifests/nginx.pp +++ b/manifests/nginx.pp @@ -134,17 +134,28 @@ class knuth::nginx { # } } - nginx::resource::location { '~ ^/~': - server => 'www.lysator.liu.se', - ssl => true, - proxy => $target, - proxy_redirect => 'http://www.lysator.liu.se $scheme://www.lysator.liu.se', + $proxies = { + '/' => 'http://localhost:8080', # Send to Roxen + '/foo/' => 'http://gibraltar:8081', + } + + $proxies.each |$location, $target| { + nginx::resource::location{ $location: + server => 'www.lysator.liu.se', + ssl => true, + proxy => $target, + # Roxen generates http headers when redirecting, since we work + # unencrypted internally. It does however answer with + # www.lysator.liu.se (first instance). Second instance of + # www.lysator.liu.se is our external server name. + proxy_redirect => 'http://www.lysator.liu.se $scheme://www.lysator.liu.se', + } } - nginx::resource::location { '/': + nginx::resource::location { '/static-test': server => 'www.lysator.liu.se', ssl => true, - alias => '/srv/www/static', + www_root => '/srv/www/static', } # Not really neeed, but peoples automatic scanners complain, and