Allow custom proxy host header to be set (#393)

*  feat: proxy header override

* 🐛 fix: missing translations key

* 🐛 fix: missing translations key, again 😅

* Update src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js

Co-authored-by: Matt Cowley <me@mattcowley.co.uk>

* 💡 chore: bump copyright year

* 🎨 refactor: update key to proxyHostHeader and i18n messages

* 🎨 refactor: fix key in template

Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
This commit is contained in:
José Manuel Casani Guerra
2022-10-08 18:54:58 +00:00
committed by GitHub
parent 4fabd0c0d9
commit 1afe9384fd
13 changed files with 47 additions and 11 deletions

View File

@@ -99,6 +99,24 @@ THE SOFTWARE.
</div>
</div>
</div>
<div v-if="proxyHostHeaderEnabled" class="field is-horizontal">
<div class="field-label">
<label class="label">{{ $t('templates.domainSections.reverseProxy.proxyHostHeader') }}</label>
</div>
<div class="field-body">
<div :class="`field${proxyHostHeaderChanged ? ' is-changed' : ''}`">
<div class="control">
<input
v-model="proxyHostHeader"
class="input"
type="text"
:placeholder="$props.data.proxyHostHeader.default"
/>
</div>
</div>
</div>
</div>
</div>
</template>
@@ -120,6 +138,10 @@ THE SOFTWARE.
default: 'http://127.0.0.1:3000',
enabled: false,
},
proxyHostHeader: {
default: '$host',
enabled: false,
},
};
export default {
@@ -157,11 +179,15 @@ THE SOFTWARE.
this.$props.data.path.computed = this.$props.data.path.value;
this.$props.data.proxyPass.enabled = true;
this.$props.data.proxyPass.computed = this.$props.data.proxyPass.value;
this.$props.data.proxyHostHeader.enabled = true;
this.$props.data.proxyHostHeader.computed = this.$props.data.proxyHostHeader.value;
} else {
this.$props.data.path.enabled = false;
this.$props.data.path.computed = '';
this.$props.data.proxyPass.enabled = false;
this.$props.data.proxyPass.computed = '';
this.$props.data.proxyHostHeader.enabled = false;
this.$props.data.proxyHostHeader.computed = '';
}
},
deep: true,