diff --git a/backend/internal/nginx.js b/backend/internal/nginx.js index fe84607f96..3ed1798f11 100644 --- a/backend/internal/nginx.js +++ b/backend/internal/nginx.js @@ -157,6 +157,8 @@ const internalNginx = { { caching_enabled: host.caching_enabled }, { block_exploits: host.block_exploits }, { allow_websocket_upgrade: host.allow_websocket_upgrade }, + { enable_proxy_protocol: host.enable_proxy_protocol }, + { load_balancer_ip: host.load_balancer_ip }, { http2_support: host.http2_support }, { hsts_enabled: host.hsts_enabled }, { hsts_subdomains: host.hsts_subdomains }, diff --git a/backend/migrations/20220209144645_proxy_protocol.js b/backend/migrations/20220209144645_proxy_protocol.js new file mode 100644 index 0000000000..8113c4eb95 --- /dev/null +++ b/backend/migrations/20220209144645_proxy_protocol.js @@ -0,0 +1,41 @@ +const migrate_name = "proxy_protocol"; +import { migrate as logger } from "../logger.js"; + +/** + * Migrate + * + * @see http://knexjs.org/#Schema + * + * @param {Object} knex + * @returns {Promise} + */ +const up = (knex) => { + logger.info(`[${migrate_name}] Migrating Up...`); + + return knex.schema.table("proxy_host", (table) => { + table.integer("enable_proxy_protocol").notNull().unsigned().defaultTo(0); + table.string("load_balancer_ip").notNull().defaultTo(""); + }).then(() => { + logger.info(`[${migrate_name}] proxy_host Table altered`); + }); +}; + +/** + * Undo Migrate + * + * @param {Object} knex + * @returns {Promise} + */ +const down = (_knex) => { + logger.info(`[${migrateName}] Migrating Down...`); + + return knex.schema.table("proxy_host", (table) => { + table.dropColumn("enable_proxy_protocol"); + table.dropColumn("load_balancer_ip"); + }) + .then(() => { + logger.info(`[${migrateName}] proxy_host Table altered`); + }); +}; + +export { up, down }; diff --git a/backend/models/proxy_host.js b/backend/models/proxy_host.js index acb8da9358..575342d3e3 100644 --- a/backend/models/proxy_host.js +++ b/backend/models/proxy_host.js @@ -22,6 +22,7 @@ const boolFields = [ "hsts_enabled", "hsts_subdomains", "trust_forwarded_proto", + "enable_proxy_protocol", ]; class ProxyHost extends Model { diff --git a/backend/schema/components/proxy-host-object.json b/backend/schema/components/proxy-host-object.json index 3ac6462136..61e943a4f6 100644 --- a/backend/schema/components/proxy-host-object.json +++ b/backend/schema/components/proxy-host-object.json @@ -17,6 +17,8 @@ "advanced_config", "meta", "allow_websocket_upgrade", + "enable_proxy_protocol", + "load_balancer_ip", "http2_support", "forward_scheme", "enabled", @@ -84,6 +86,18 @@ "type": "boolean", "example": true }, + "enable_proxy_protocol": { + "description": "Enable PROXY Protocol support", + "example": true, + "type": "boolean" + }, + "load_balancer_ip": { + "description": "Load balancer or TCP proxy IP / CIDR range", + "type": "string", + "minLength": 0, + "maxLength": 255, + "example": "10.0.9.3" + }, "http2_support": { "$ref": "../common.json#/properties/http2_support" }, diff --git a/backend/schema/paths/nginx/proxy-hosts/get.json b/backend/schema/paths/nginx/proxy-hosts/get.json index 301e28bfdf..66ec45cfae 100644 --- a/backend/schema/paths/nginx/proxy-hosts/get.json +++ b/backend/schema/paths/nginx/proxy-hosts/get.json @@ -53,6 +53,8 @@ "nginx_err": null }, "allow_websocket_upgrade": false, + "enable_proxy_protocol": false, + "load_balancer_ip": "", "http2_support": false, "forward_scheme": "http", "enabled": true, diff --git a/backend/schema/paths/nginx/proxy-hosts/hostID/get.json b/backend/schema/paths/nginx/proxy-hosts/hostID/get.json index 2e677fed32..bb1d04a90e 100644 --- a/backend/schema/paths/nginx/proxy-hosts/hostID/get.json +++ b/backend/schema/paths/nginx/proxy-hosts/hostID/get.json @@ -50,6 +50,8 @@ "nginx_err": null }, "allow_websocket_upgrade": false, + "enable_proxy_protocol": false, + "load_balancer_ip": "", "http2_support": false, "forward_scheme": "http", "enabled": true, diff --git a/backend/schema/paths/nginx/proxy-hosts/hostID/put.json b/backend/schema/paths/nginx/proxy-hosts/hostID/put.json index fc3198456b..2d051644ea 100644 --- a/backend/schema/paths/nginx/proxy-hosts/hostID/put.json +++ b/backend/schema/paths/nginx/proxy-hosts/hostID/put.json @@ -71,6 +71,12 @@ "allow_websocket_upgrade": { "$ref": "../../../../components/proxy-host-object.json#/properties/allow_websocket_upgrade" }, + "enable_proxy_protocol": { + "$ref": "../../../../components/proxy-host-object.json#/properties/enable_proxy_protocol" + }, + "load_balancer_ip": { + "$ref": "../../../../components/proxy-host-object.json#/properties/load_balancer_ip" + }, "access_list_id": { "$ref": "../../../../components/proxy-host-object.json#/properties/access_list_id" }, @@ -119,6 +125,8 @@ "nginx_err": null }, "allow_websocket_upgrade": false, + "enable_proxy_protocol": false, + "load_balancer_ip": "", "http2_support": false, "forward_scheme": "http", "enabled": true, diff --git a/backend/schema/paths/nginx/proxy-hosts/post.json b/backend/schema/paths/nginx/proxy-hosts/post.json index 28ddad8fc2..b9124c9578 100644 --- a/backend/schema/paths/nginx/proxy-hosts/post.json +++ b/backend/schema/paths/nginx/proxy-hosts/post.json @@ -63,6 +63,12 @@ "allow_websocket_upgrade": { "$ref": "../../../components/proxy-host-object.json#/properties/allow_websocket_upgrade" }, + "enable_proxy_protocol": { + "$ref": "../../../components/proxy-host-object.json#/properties/enable_proxy_protocol" + }, + "load_balancer_ip": { + "$ref": "../../../components/proxy-host-object.json#/properties/load_balancer_ip" + }, "access_list_id": { "$ref": "../../../components/proxy-host-object.json#/properties/access_list_id" }, @@ -116,6 +122,8 @@ "advanced_config": "", "meta": {}, "allow_websocket_upgrade": false, + "enable_proxy_protocol": false, + "load_balancer_ip": "", "http2_support": false, "forward_scheme": "http", "enabled": true, diff --git a/backend/templates/_listen.conf b/backend/templates/_listen.conf index 34a808e6a0..1d66472896 100644 --- a/backend/templates/_listen.conf +++ b/backend/templates/_listen.conf @@ -1,20 +1,38 @@ +{% if enable_proxy_protocol == 1 or enable_proxy_protocol == true%} + listen 88 proxy_protocol; + listen 80; +{% if ipv6 -%} + listen [::]:88 proxy_protocol; + listen [::]:80; +{% endif %} +{% else -%} listen 80; {% if ipv6 -%} listen [::]:80; {% else -%} #listen [::]:80; +{% endif %} {% endif %} {% if certificate -%} +{% if enable_proxy_protocol == 1 or enable_proxy_protocol == true%} + listen 444 ssl proxy_protocol; + listen 443 ssl; +{% if ipv6 -%} + listen [::]:444 ssl proxy_protocol; + listen [::]:443 ssl; +{% endif %} +{% else -%} listen 443 ssl; {% if ipv6 -%} listen [::]:443 ssl; {% else -%} #listen [::]:443; {% endif %} +{% endif %} {% endif %} server_name {{ domain_names | join: " " }}; {% if http2_support == 1 or http2_support == true %} http2 on; {% else -%} http2 off; -{% endif %} \ No newline at end of file +{% endif %} diff --git a/backend/templates/_proxy_protocol.conf b/backend/templates/_proxy_protocol.conf new file mode 100644 index 0000000000..acba5e13b3 --- /dev/null +++ b/backend/templates/_proxy_protocol.conf @@ -0,0 +1,6 @@ +{% if enable_proxy_protocol == 1 or enable_proxy_protocol == true %} +{% if load_balancer_ip != '' %} + set_real_ip_from {{ load_balancer_ip }}; +{% endif %} +real_ip_header proxy_protocol; +{% endif %} diff --git a/backend/templates/proxy_host.conf b/backend/templates/proxy_host.conf index d23ca46fa2..e753b6dde1 100644 --- a/backend/templates/proxy_host.conf +++ b/backend/templates/proxy_host.conf @@ -15,6 +15,7 @@ server { {% include "_exploits.conf" %} {% include "_hsts.conf" %} {% include "_forced_ssl.conf" %} +{% include "_proxy_protocol.conf" %} {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %} proxy_set_header Upgrade $http_upgrade; diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 4d519f8acd..8c316ac513 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -9,7 +9,9 @@ services: ports: - 3080:80 - 3081:81 + - 3088:88 - 3443:443 + - 3444:444 networks: nginx_proxy_manager: aliases: diff --git a/frontend/src/api/backend/models.ts b/frontend/src/api/backend/models.ts index 2ae0b08348..d102b75557 100644 --- a/frontend/src/api/backend/models.ts +++ b/frontend/src/api/backend/models.ts @@ -122,6 +122,8 @@ export interface ProxyHost { advancedConfig: string; meta: Record; allowWebsocketUpgrade: boolean; + enableProxyProtocol: boolean; + loadBalancerIp: string; http2Support: boolean; enabled: boolean; locations?: ProxyLocation[]; diff --git a/frontend/src/hooks/useProxyHost.ts b/frontend/src/hooks/useProxyHost.ts index 24e7f4fae2..21b906a2d2 100644 --- a/frontend/src/hooks/useProxyHost.ts +++ b/frontend/src/hooks/useProxyHost.ts @@ -19,6 +19,8 @@ const fetchProxyHost = (id: number | "new") => { advancedConfig: "", meta: {}, allowWebsocketUpgrade: false, + enableProxyProtocol: false, + loadBalancerIp: "", http2Support: false, forwardScheme: "", enabled: true, diff --git a/frontend/src/locale/src/bg.json b/frontend/src/locale/src/bg.json index 5183fe315b..8e03e0e926 100644 --- a/frontend/src/locale/src/bg.json +++ b/frontend/src/locale/src/bg.json @@ -365,6 +365,9 @@ "host.flags.cache-assets": { "defaultMessage": "Кеширане на ресурси" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Запазване на пътя" }, @@ -380,6 +383,9 @@ "host.forward-scheme": { "defaultMessage": "Схема" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Хостове" }, diff --git a/frontend/src/locale/src/cs.json b/frontend/src/locale/src/cs.json index cd86b678dc..f935fbb58a 100644 --- a/frontend/src/locale/src/cs.json +++ b/frontend/src/locale/src/cs.json @@ -422,6 +422,9 @@ "host.flags.cache-assets": { "defaultMessage": "Uložit zdroje do mezipaměti" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Zachovat cestu" }, @@ -437,6 +440,9 @@ "host.forward-scheme": { "defaultMessage": "Schéma" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hostitelé" }, diff --git a/frontend/src/locale/src/de.json b/frontend/src/locale/src/de.json index f654e10858..0905c8dc9f 100644 --- a/frontend/src/locale/src/de.json +++ b/frontend/src/locale/src/de.json @@ -350,6 +350,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache Assets" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Pfad beibehalten" }, @@ -365,6 +368,9 @@ "host.forward-scheme": { "defaultMessage": "Schema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hosts" }, diff --git a/frontend/src/locale/src/en.json b/frontend/src/locale/src/en.json index bb00ac3322..cb3a642d6c 100644 --- a/frontend/src/locale/src/en.json +++ b/frontend/src/locale/src/en.json @@ -428,6 +428,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache Assets" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Preserve Path" }, @@ -443,6 +446,9 @@ "host.forward-scheme": { "defaultMessage": "Scheme" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hosts" }, diff --git a/frontend/src/locale/src/es.json b/frontend/src/locale/src/es.json index c8b1edb075..04b62cc2a4 100644 --- a/frontend/src/locale/src/es.json +++ b/frontend/src/locale/src/es.json @@ -365,6 +365,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cachear Recursos" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Preservar Ruta" }, @@ -380,6 +383,9 @@ "host.forward-scheme": { "defaultMessage": "Esquema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hosts" }, diff --git a/frontend/src/locale/src/et.json b/frontend/src/locale/src/et.json index bb00ac3322..cb3a642d6c 100644 --- a/frontend/src/locale/src/et.json +++ b/frontend/src/locale/src/et.json @@ -428,6 +428,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache Assets" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Preserve Path" }, @@ -443,6 +446,9 @@ "host.forward-scheme": { "defaultMessage": "Scheme" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hosts" }, diff --git a/frontend/src/locale/src/fr.json b/frontend/src/locale/src/fr.json index c715c028a6..a35d30cba0 100644 --- a/frontend/src/locale/src/fr.json +++ b/frontend/src/locale/src/fr.json @@ -338,6 +338,9 @@ "host.flags.cache-assets": { "defaultMessage": "Ressources du cache" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Préserver le chemin" }, @@ -353,6 +356,9 @@ "host.forward-scheme": { "defaultMessage": "Schéma" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hôtes" }, diff --git a/frontend/src/locale/src/ga.json b/frontend/src/locale/src/ga.json index 719b863bf0..700b3877ea 100644 --- a/frontend/src/locale/src/ga.json +++ b/frontend/src/locale/src/ga.json @@ -353,6 +353,9 @@ "host.flags.cache-assets": { "defaultMessage": "Sócmhainní Taisce" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Cosán a Chaomhnú" }, @@ -368,6 +371,9 @@ "host.forward-scheme": { "defaultMessage": "Scéim" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Óstaigh" }, diff --git a/frontend/src/locale/src/hu.json b/frontend/src/locale/src/hu.json index 4caf058344..a53d5e89f9 100644 --- a/frontend/src/locale/src/hu.json +++ b/frontend/src/locale/src/hu.json @@ -422,6 +422,9 @@ "host.flags.cache-assets": { "defaultMessage": "Erőforrások gyorsítótárazása" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Útvonal megőrzése" }, @@ -437,6 +440,9 @@ "host.forward-scheme": { "defaultMessage": "Séma" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Kiszolgálók" }, diff --git a/frontend/src/locale/src/id.json b/frontend/src/locale/src/id.json index cb498f0d88..7e39faaab9 100644 --- a/frontend/src/locale/src/id.json +++ b/frontend/src/locale/src/id.json @@ -353,6 +353,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache Aset" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Pertahankan Path" }, @@ -368,6 +371,9 @@ "host.forward-scheme": { "defaultMessage": "Skema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Host" }, diff --git a/frontend/src/locale/src/it.json b/frontend/src/locale/src/it.json index 7e5ca77113..bffdb5a3e3 100644 --- a/frontend/src/locale/src/it.json +++ b/frontend/src/locale/src/it.json @@ -350,6 +350,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache degli Asset" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Preserva Percorso" }, @@ -365,6 +368,9 @@ "host.forward-scheme": { "defaultMessage": "Schema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Host" }, diff --git a/frontend/src/locale/src/ja.json b/frontend/src/locale/src/ja.json index 438dc218d3..18ff154936 100644 --- a/frontend/src/locale/src/ja.json +++ b/frontend/src/locale/src/ja.json @@ -350,6 +350,9 @@ "host.flags.cache-assets": { "defaultMessage": "アセットをキャッシュする" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "パスワードは一致する必要があります" }, @@ -365,6 +368,9 @@ "host.forward-scheme": { "defaultMessage": "スキーム" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "ホスト" }, diff --git a/frontend/src/locale/src/ko.json b/frontend/src/locale/src/ko.json index 9c0093591b..811614a728 100644 --- a/frontend/src/locale/src/ko.json +++ b/frontend/src/locale/src/ko.json @@ -365,6 +365,9 @@ "host.flags.cache-assets": { "defaultMessage": "정적 에셋 캐싱" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "요청 경로 유지" }, @@ -380,6 +383,9 @@ "host.forward-scheme": { "defaultMessage": "프로토콜" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "호스트 목록" }, diff --git a/frontend/src/locale/src/nl.json b/frontend/src/locale/src/nl.json index 81c37054ba..a90e88ce4a 100644 --- a/frontend/src/locale/src/nl.json +++ b/frontend/src/locale/src/nl.json @@ -350,6 +350,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache Assets" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Pad Behouden" }, @@ -365,6 +368,9 @@ "host.forward-scheme": { "defaultMessage": "Schema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hosts" }, diff --git a/frontend/src/locale/src/no.json b/frontend/src/locale/src/no.json index f14ea54b11..c819db8760 100644 --- a/frontend/src/locale/src/no.json +++ b/frontend/src/locale/src/no.json @@ -428,6 +428,9 @@ "host.flags.cache-assets": { "defaultMessage": "Mellomlagre ressurser" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Behold sti" }, @@ -443,6 +446,9 @@ "host.forward-scheme": { "defaultMessage": "Skjema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Vertsnavn" }, diff --git a/frontend/src/locale/src/pl.json b/frontend/src/locale/src/pl.json index a5fb2ad0be..71e6bd95b7 100644 --- a/frontend/src/locale/src/pl.json +++ b/frontend/src/locale/src/pl.json @@ -356,6 +356,9 @@ "host.flags.cache-assets": { "defaultMessage": "Buforuj zasoby statyczne (ang. cache)" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Zachowaj ścieżkę" }, @@ -371,6 +374,9 @@ "host.forward-scheme": { "defaultMessage": "Schemat" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hosty" }, diff --git a/frontend/src/locale/src/pt.json b/frontend/src/locale/src/pt.json index 0a789f484e..d607633861 100644 --- a/frontend/src/locale/src/pt.json +++ b/frontend/src/locale/src/pt.json @@ -353,6 +353,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache de Conteúdos Estáticos" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Preservar Caminho" }, @@ -368,6 +371,9 @@ "host.forward-scheme": { "defaultMessage": "Esquema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hosts" }, diff --git a/frontend/src/locale/src/ru.json b/frontend/src/locale/src/ru.json index 44dff1294c..97582ec955 100644 --- a/frontend/src/locale/src/ru.json +++ b/frontend/src/locale/src/ru.json @@ -350,6 +350,9 @@ "host.flags.cache-assets": { "defaultMessage": "Кэшировать ресурсы" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Сохранять путь" }, @@ -365,6 +368,9 @@ "host.forward-scheme": { "defaultMessage": "Схема" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Хосты" }, diff --git a/frontend/src/locale/src/sk.json b/frontend/src/locale/src/sk.json index 8d48cf811e..5d91bec89c 100644 --- a/frontend/src/locale/src/sk.json +++ b/frontend/src/locale/src/sk.json @@ -422,6 +422,9 @@ "host.flags.cache-assets": { "defaultMessage": "Uložiť zdroje do vyrovnávacej pamäte" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Zachovať cestu" }, @@ -437,6 +440,9 @@ "host.forward-scheme": { "defaultMessage": "Schéma" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Hostitelia" }, diff --git a/frontend/src/locale/src/tr.json b/frontend/src/locale/src/tr.json index 972fa895ec..b7dc4890e0 100644 --- a/frontend/src/locale/src/tr.json +++ b/frontend/src/locale/src/tr.json @@ -353,6 +353,9 @@ "host.flags.cache-assets": { "defaultMessage": "Varlıkları Önbelleğe Al" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Yolu Koru" }, @@ -368,6 +371,9 @@ "host.forward-scheme": { "defaultMessage": "Şema" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Host'lar" }, diff --git a/frontend/src/locale/src/vi.json b/frontend/src/locale/src/vi.json index 32d26d5590..2e498f7c69 100644 --- a/frontend/src/locale/src/vi.json +++ b/frontend/src/locale/src/vi.json @@ -350,6 +350,9 @@ "host.flags.cache-assets": { "defaultMessage": "Cache tài nguyên" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "Bảo toàn đường dẫn" }, @@ -365,6 +368,9 @@ "host.forward-scheme": { "defaultMessage": "Scheme" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "Máy chủ" }, diff --git a/frontend/src/locale/src/zh.json b/frontend/src/locale/src/zh.json index 72494bb64f..7431a9f89a 100644 --- a/frontend/src/locale/src/zh.json +++ b/frontend/src/locale/src/zh.json @@ -356,6 +356,9 @@ "host.flags.cache-assets": { "defaultMessage": "缓存资源" }, + "host.flags.enable-proxy-protocol": { + "defaultMessage": "Enable PROXY Protocol" + }, "host.flags.preserve-path": { "defaultMessage": "保留路径" }, @@ -371,6 +374,9 @@ "host.forward-scheme": { "defaultMessage": "协议" }, + "host.load-balancer-ip": { + "defaultMessage": "Load balancer or TCP proxy IP / CIDR range" + }, "hosts": { "defaultMessage": "主机列表" }, diff --git a/frontend/src/modals/ProxyHostModal.tsx b/frontend/src/modals/ProxyHostModal.tsx index 3227be51bb..f110c737e5 100644 --- a/frontend/src/modals/ProxyHostModal.tsx +++ b/frontend/src/modals/ProxyHostModal.tsx @@ -80,6 +80,8 @@ const ProxyHostModal = EasyModal.create(({ id, visible, remove }: Props) => { cachingEnabled: data?.cachingEnabled || false, blockExploits: data?.blockExploits || false, allowWebsocketUpgrade: data?.allowWebsocketUpgrade || false, + enableProxyProtocol: data?.enableProxyProtocol || false, + loadBalancerIp: data?.loadBalancerIp || "", // Locations tab locations: data?.locations || [], // SSL tab @@ -328,6 +330,59 @@ const ProxyHostModal = EasyModal.create(({ id, visible, remove }: Props) => { +
+ +
+
+ + {({ field, form }: any) => ( +
+ + + {form.errors.loadBalancerIp ? ( +
+ {form.errors.loadBalancerIp && + form.touched.loadBalancerIp + ? form.errors.loadBalancerIp + : null} +
+ ) : null} +
+ )} +
+
diff --git a/scripts/start-dev b/scripts/start-dev index c561ac9adf..0652bddc1f 100755 --- a/scripts/start-dev +++ b/scripts/start-dev @@ -45,9 +45,14 @@ if hash docker 2>/dev/null; then bash "$DIR/wait-healthy" "$(docker compose ps --all -q fullstack)" 120 echo "" - echo -e "${CYAN}Admin UI: http://127.0.0.1:3081${RESET}" - echo -e "${CYAN}Nginx: http://127.0.0.1:3080${RESET}" - echo -e "${CYAN}Swagger Doc: http://127.0.0.1:3001${RESET}" + echo -e "${CYAN}Admin UI: http://127.0.0.1:3081${RESET}" + echo -e "${CYAN}Nginx (HTTP): http://127.0.0.1:3080${RESET}" + echo -e "${CYAN}Nginx (HTTPS): http://127.0.0.1:3443${RESET}" + echo -e "${CYAN}Swagger Doc: http://127.0.0.1:3001${RESET}" + echo -e + echo -e "${CYAN}PROXY protocol:${RESET}" + echo -e "${CYAN}Nginx (HTTP): http://127.0.0.1:3088${RESET}" + echo -e "${CYAN}Nginx (HTTPS): http://127.0.0.1:3444${RESET}" echo "" if [ "$1" == "-f" ]; then