Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nest
Puppet
Commits
c388a1b8
Commit
c388a1b8
authored
Nov 28, 2020
by
James T. Lee
Browse files
revproxy: proxy_pass -> proxy_pass_match
parent
62547117
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
39 deletions
+19
-39
manifests/lib/revproxy.pp
manifests/lib/revproxy.pp
+13
-33
manifests/node/falcon.pp
manifests/node/falcon.pp
+6
-6
No files found.
manifests/lib/revproxy.pp
View file @
c388a1b8
...
@@ -6,10 +6,19 @@ define nest::lib::revproxy (
...
@@ -6,10 +6,19 @@ define nest::lib::revproxy (
Optional
[
Integer
]
$port
=
undef
,
Optional
[
Integer
]
$port
=
undef
,
Boolean
$ssl
=
true
,
Boolean
$ssl
=
true
,
Optional
[
String
[
1
]]
$websockets
=
undef
,
Optional
[
String
[
1
]]
$websockets
=
undef
,
Array
[
String
[
1
]]
$websockets_exceptions
=
[],
Boolean
$preserve_host
=
false
,
Boolean
$preserve_host
=
false
,
Hash
[
String
[
1
],
Any
]
$extra_params
=
{},
Hash
[
String
[
1
],
Any
]
$extra_params
=
{},
)
{
)
{
if
$websockets
{
include
'::apache::mod::proxy_wstunnel'
$websockets_proxy_pass
=
[{
'path'
=>
"^/(
${websockets}
)
$
"
,
'url'
=>
"ws://
${destination}
/
\$
1"
,
'reverse_urls'
=>
[]
}]
}
$certbot_exception
=
@
(
EOT
)
$certbot_exception
=
@
(
EOT
)
<
Location
"/.well-known"
>
<
Location
"/.well-known"
>
AllowOverride
None
AllowOverride
None
...
@@ -18,36 +27,6 @@ define nest::lib::revproxy (
...
@@ -18,36 +27,6 @@ define nest::lib::revproxy (
</
Location
>
</
Location
>
|
EOT
|
EOT
if
$websockets
{
include
'::apache::mod::proxy_wstunnel'
}
$wsdestination
=
$destination
.
regsubst
(
'^http'
,
'ws'
)
.
regsubst
(
'/$'
,
''
)
$wsexceptiondest
=
$destination
.
regsubst
(
'/$'
,
''
)
$proxy_params
=
$destination
?
{
/
(
localhost|127
\.
0
\.
0
\.
1
)
/
=>
{},
default
=>
{
'keepalive'
=>
'On'
},
}
$websockets_exceptions_proxy_pass
=
$websockets_exceptions
.
map
|
$ex
|
{
{
'path'
=>
$ex
,
'url'
=>
"
${wsexceptiondest}${ex}
"
,
'params'
=>
$proxy_params
}
}
$proxy_pass
=
[
$websockets_exceptions_proxy_pass
,
$websockets
?
{
undef
=>
[],
default
=>
{
'path'
=>
$websockets
,
'url'
=>
"
${wsdestination}${websockets}
"
,
'params'
=>
$proxy_params
},
},
$websockets
?
{
'/'
=>
[],
default
=>
{
'path'
=>
'/'
,
'url'
=>
$destination
,
'params'
=>
$proxy_params
},
}
]
.
flatten
nest::lib::vhost
{
$name
:
nest::lib::vhost
{
$name
:
servername
=>
$servername
,
servername
=>
$servername
,
serveraliases
=>
$serveraliases
,
serveraliases
=>
$serveraliases
,
...
@@ -56,9 +35,10 @@ define nest::lib::revproxy (
...
@@ -56,9 +35,10 @@ define nest::lib::revproxy (
ssl
=>
$ssl
,
ssl
=>
$ssl
,
zfs_docroot
=>
false
,
zfs_docroot
=>
false
,
extra_params
=>
{
extra_params
=>
{
'custom_fragment'
=>
$certbot_exception
,
'proxy_pass'
=>
$proxy_pass
,
'proxy_preserve_host'
=>
$preserve_host
,
'proxy_preserve_host'
=>
$preserve_host
,
'proxy_pass_match'
=>
$websockets_proxy_pass
,
'proxy_dest'
=>
"http://
${destination}
"
,
'custom_fragment'
=>
$certbot_exception
,
}
+
$extra_params
,
}
+
$extra_params
,
}
}
}
}
manifests/node/falcon.pp
View file @
c388a1b8
...
@@ -188,24 +188,24 @@ class nest::node::falcon {
...
@@ -188,24 +188,24 @@ class nest::node::falcon {
;
;
'nzbget.nest'
:
'nzbget.nest'
:
destination
=>
'
http://
localhost:6789
/
'
,
destination
=>
'localhost:6789'
,
;
;
'ombi.nest'
:
'ombi.nest'
:
destination
=>
'
http://
localhost:3579
/
'
,
destination
=>
'localhost:3579'
,
;
;
'plex.nest'
:
'plex.nest'
:
destination
=>
'
http://
localhost:32400
/
'
,
destination
=>
'localhost:32400'
,
websockets
=>
'
/
:/websockets/'
,
websockets
=>
':/websockets/
.*
'
,
;
;
'radarr.nest'
:
'radarr.nest'
:
destination
=>
'
http://
localhost:7878
/
'
,
destination
=>
'localhost:7878'
,
;
;
'sonarr.nest'
:
'sonarr.nest'
:
destination
=>
'
http://
localhost:8989
/
'
,
destination
=>
'localhost:8989'
,
;
;
}
}
...
...
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