Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b687548
Merge pull request 'Fork syncthing' (#1) from GitHub/nginx-proxy-mana…
SBado Feb 23, 2022
ecb2752
PROXY Protocol support implementation
SBado Feb 23, 2022
9eabfb9
Merge branch 'NginxProxyManager:develop' into develop
SBado Jun 10, 2022
6c5f198
Merge branch 'develop' into develop
SBado Oct 13, 2022
54864f4
Merge branch 'NginxProxyManager:develop' into develop
SBado Mar 21, 2023
cc6d249
Merge branch 'NginxProxyManager:develop' into develop
SBado May 11, 2023
1eb6a57
Merge branch 'NginxProxyManager:develop' into develop
SBado Sep 1, 2023
fe8f853
Merge branch 'develop' of ssh://github.com/NginxProxyManager/nginx-pr…
adrum Apr 5, 2025
5e73361
bump build
adrum Apr 29, 2025
cf4965c
Update proxy_host.js
Iaotle Jul 1, 2025
db2f4d4
Merge pull request #1 from NikeLaosClericus/patch-1
NikeLaosClericus Jul 16, 2025
1e080c2
enable standard ports when proxy protocol is enabled
adrum Jul 25, 2025
5d14b74
always enable real ip proxy protocol if enabled
adrum Jul 25, 2025
473dbc7
Merge remote-tracking branch 'adrum/develop' into proxy-protocol
reversefold Apr 24, 2026
aa8ac9b
Fix migration script
reversefold Apr 24, 2026
c9c9b0b
Sorted lang files
reversefold Apr 24, 2026
24bdb5d
Fix comments
reversefold Apr 24, 2026
5ec08cf
Fill out missing schema
reversefold Apr 24, 2026
49bb743
Add PROXY protocol ports
reversefold Apr 24, 2026
d9990df
conditionally require and disable the load balancer ip
reversefold Apr 24, 2026
6618f15
Fix lint errors
reversefold Apr 24, 2026
857a35e
Implement down migration and standardize on double quotes
reversefold Apr 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/internal/nginx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
41 changes: 41 additions & 0 deletions backend/migrations/20220209144645_proxy_protocol.js
Original file line number Diff line number Diff line change
@@ -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 };
1 change: 1 addition & 0 deletions backend/models/proxy_host.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const boolFields = [
"hsts_enabled",
"hsts_subdomains",
"trust_forwarded_proto",
"enable_proxy_protocol",
];

class ProxyHost extends Model {
Expand Down
14 changes: 14 additions & 0 deletions backend/schema/components/proxy-host-object.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"advanced_config",
"meta",
"allow_websocket_upgrade",
"enable_proxy_protocol",
"load_balancer_ip",
"http2_support",
"forward_scheme",
"enabled",
Expand Down Expand Up @@ -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"
},
Expand Down
2 changes: 2 additions & 0 deletions backend/schema/paths/nginx/proxy-hosts/get.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions backend/schema/paths/nginx/proxy-hosts/hostID/get.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions backend/schema/paths/nginx/proxy-hosts/hostID/put.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions backend/schema/paths/nginx/proxy-hosts/post.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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,
Expand Down
20 changes: 19 additions & 1 deletion backend/templates/_listen.conf
Original file line number Diff line number Diff line change
@@ -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 %}
{% endif %}
6 changes: 6 additions & 0 deletions backend/templates/_proxy_protocol.conf
Original file line number Diff line number Diff line change
@@ -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 %}
1 change: 1 addition & 0 deletions backend/templates/proxy_host.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ services:
ports:
- 3080:80
- 3081:81
- 3088:88
- 3443:443
- 3444:444
networks:
nginx_proxy_manager:
aliases:
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/api/backend/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ export interface ProxyHost {
advancedConfig: string;
meta: Record<string, any>;
allowWebsocketUpgrade: boolean;
enableProxyProtocol: boolean;
loadBalancerIp: string;
http2Support: boolean;
enabled: boolean;
locations?: ProxyLocation[];
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/hooks/useProxyHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const fetchProxyHost = (id: number | "new") => {
advancedConfig: "",
meta: {},
allowWebsocketUpgrade: false,
enableProxyProtocol: false,
loadBalancerIp: "",
http2Support: false,
forwardScheme: "",
enabled: true,
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@
"host.flags.cache-assets": {
"defaultMessage": "Кеширане на ресурси"
},
"host.flags.enable-proxy-protocol": {
"defaultMessage": "Enable PROXY Protocol"
},
"host.flags.preserve-path": {
"defaultMessage": "Запазване на пътя"
},
Expand All @@ -380,6 +383,9 @@
"host.forward-scheme": {
"defaultMessage": "Схема"
},
"host.load-balancer-ip": {
"defaultMessage": "Load balancer or TCP proxy IP / CIDR range"
},
"hosts": {
"defaultMessage": "Хостове"
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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é"
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/locale/src/ga.json
Original file line number Diff line number Diff line change
Expand Up @@ -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ú"
},
Expand All @@ -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"
},
Expand Down
Loading