nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Enable PROXY procotol for proxy hosts and streams

Open snordmann opened this issue 2 years ago • 7 comments

As I see not too much progress in https://github.com/NginxProxyManager/nginx-proxy-manager/pull/3537, I decided to copy most of the code and (try to) fix the tests. In this PR I also included the code necessary to enable the PROXY protocol for Streams.

Thank you @jwklijnsma for the previous work

snordmann avatar Mar 10 '24 08:03 snordmann

CI is reporting:

Integration Tests / Mysql / Hosts endpoints.Should be able to create a http host

Error Message:
data should NOT have additional properties, data should have required property 'proxy_support_enabled'

Cypress output:

[validateSwaggerSchema DEBUG] Endpoint: /nginx/proxy-hosts
[validateSwaggerSchema DEBUG] Response Schema: {
  "id": 1,
  "created_on": "2024-03-10T10:06:30.000Z",
  "modified_on": "2024-03-10T10:06:30.000Z",
  "owner_user_id": 1,
  "domain_names": [
    "test.example.com"
  ],
  "forward_host": "1.1.1.1",
  "forward_port": 80,
  "access_list_id": 0,
  "certificate_id": 0,
  "ssl_forced": 0,
  "caching_enabled": 0,
  "block_exploits": 0,
  "advanced_config": "",
  "meta": {
    "letsencrypt_agree": false,
    "dns_challenge": false
  },
  "allow_websocket_upgrade": 0,
  "http2_support": 0,
  "forward_scheme": "http",
  "enabled": 1,
  "locations": [],
  "hsts_enabled": 0,
  "hsts_subdomains": 0,
  "enable_proxy_protocol": 0,
  "load_balancer_ip": "",
  "certificate": null,
  "owner": {
    "id": 1,
    "created_on": "2024-03-10T10:06:18.000Z",
    "modified_on": "2024-03-10T10:06:18.000Z",
    "is_deleted": 0,
    "is_disabled": 0,
    "email": "[email protected]",
    "name": "Administrator",
    "nickname": "Admin",
    "avatar": "",
    "roles": [
      "admin"
    ]
  },
  "access_list": null,
  "use_default_location": true,
  "ipv6": true
}
[validateSwaggerSchema ERROR] data should NOT have additional properties, data should have required property 'proxy_support_enabled'

jc21 avatar Mar 10 '24 10:03 jc21

One question I do have: How should we show the user, that udp and proxy_protocol are exclusive options on a listener? Currently I just silently drop the proxy_protocol option for the UDP listener, but I am unsure that this is a good implementation.

I imagine that we could also disable the UDP button, when "Enable Proxy Protocol" is pressed.

snordmann avatar Mar 10 '24 10:03 snordmann

Docker Image for build 6 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-3618

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

As I see not too much progress in #3537, I decided to copy most of the code and (try to) fix the tests. In this PR I also included the code necessary to enable the PROXY protocol for Streams.

Thank you @jwklijnsma for the previous work but thnx for it

The plan was to fix the test next week

jwklijnsma avatar Mar 10 '24 11:03 jwklijnsma

what needs be done for mr @jc21

jwklijnsma avatar May 08 '24 09:05 jwklijnsma

Any update on this?

qnlbnsl avatar Jul 17 '24 20:07 qnlbnsl

Any latest news about proxy_protocol?

somnifex avatar Aug 23 '24 09:08 somnifex

@jc21 would you be able to merge this PR when I resolve all the conflicts?

snordmann avatar Oct 22 '24 18:10 snordmann

tbh, might be easier to start again from the current develop branch. I will close this PR and open a new one once I am done with the re-implementation.

snordmann avatar Oct 22 '24 19:10 snordmann