change proxypassreverse to custom code

This commit is contained in:
Antonio J. Delgado 2023-11-28 19:41:15 +02:00
parent 089b75e21f
commit 1a0570a495

View file

@ -311,21 +311,21 @@ class mastodon (
require => File["${mastodon_home}/live/.env.production"],
}
apache::vhost { $hostname:
ensure => $ensure,
access_log_file => $hostname,
error_log_file => $hostname,
docroot => "${mastodon_home}/live/public",
manage_docroot => false,
proxy_preserve_host => true,
proxy_add_headers => true,
port => 443,
priority => 15,
protocols => [
ensure => $ensure,
access_log_file => $hostname,
error_log_file => $hostname,
docroot => "${mastodon_home}/live/public",
manage_docroot => false,
proxy_preserve_host => true,
proxy_add_headers => true,
port => 443,
priority => 15,
protocols => [
'h2',
'http/1.1',
],
protocols_honor_order => true,
proxy_pass => [
protocols_honor_order => true,
proxy_pass => [
{ 'path' => '/500.html', 'url' => '!' },
{ 'path' => '/sw.js', 'url' => '!' },
{ 'path' => '/robots.txt', 'url' => '!' },
@ -333,19 +333,21 @@ class mastodon (
{ 'path' => '/browserconfig.xml', 'url' => '!' },
{ 'path' => '/mask-icon.svg', 'url' => '!' },
],
proxy_dest_reverse_match => [
{ 'path' => '/api/v1/streaming', 'url' => 'ws://localhost:4000' },
{ 'path' => '/', 'url' => 'http://localhost:3000/' },
],
proxy_pass_match => [
custom_fragment => '
ProxyPass /api/v1/streaming ws://localhost:4000
ProxyPassReverse /api/v1/streaming ws://localhost:4000
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
',
proxy_pass_match => [
{ 'path' => '^(/.*\.(png|ico)$)', 'url' => '!' },
{ 'path' => '^/(assets|avatars|emoji|headers|packs|sounds|system)', 'url' => '!' },
],
request_headers => [
request_headers => [
'set X-Forwarded-Proto "https"',
],
headers => ['always set Strict-Transport-Security "max-age=31536000"'],
directories => [
headers => ['always set Strict-Transport-Security "max-age=31536000"'],
directories => [
{
'path' => '^/(assets|avatars|emoji|headers|packs|sounds|system)',
'provider' => 'locationmatch',
@ -359,7 +361,7 @@ class mastodon (
'require' => 'all granted',
},
],
error_documents => [
error_documents => [
{ 'error_code' => '500', 'document' => '/500' },
{ 'error_code' => '501', 'document' => '/501' },
{ 'error_code' => '502', 'document' => '/502' },