Skip to content

allow ___domain like 'com.example.com:8080' #2611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

constanine
Copy link

Allow proxy_host configuration use exteranl port like com.example.com:8080.
Modify nginx.js ,then it can judge domain_name contains exteranl port with ":",and full listen port in _listen.conf.
Also in proxy_host.conf,proxy_set_header Host is added to fix browser‘s href ___location

@jc21
Copy link
Member

jc21 commented Mar 7, 2023

08:30:07  $ /app/node_modules/.bin/eslint .
08:30:07  
08:30:07  /app/internal/nginx.js
08:30:07    35:13  error  Parsing error: Unexpected token use_default_port
08:30:07  
08:30:07  ✖ 1 problem (1 error, 0 warnings)

@zpaul91
Copy link

zpaul91 commented Oct 4, 2023

Hello,
I wanted to try to use this pull request,
I get an error, and no nginx conf is written:
2023/10/04 07:17:51 [emerg] 435#435: host not found in "listen_port" of the "listen" directive in /data/nginx/proxy_host/3.conf:16
Next, when I docker logs the container, I get

[10/4/2023] [7:04:47 AM] [Nginx    ] ⺠⹠ info      Reloading Nginx
[10/4/2023] [7:17:51 AM] [Nginx    ] ⺠⬤  debug     Deleting file: /data/nginx/proxy_host/3.conf
[10/4/2023] [7:17:51 AM] [Nginx    ] ⺠⬤  debug     Deleting file: /data/nginx/proxy_host/3.conf
[10/4/2023] [7:17:51 AM] [Nginx    ] ⺠⬤  debug     Could not delete file: {
  "errno": -2,
  "syscall": "unlink",
  "code": "ENOENT",
  "path": "/data/nginx/proxy_host/3.conf"
}
[10/4/2023] [7:17:51 AM] [Nginx    ] ⺠⬤  debug     Deleting file: /data/nginx/proxy_host/3.conf.err
[10/4/2023] [7:17:51 AM] [Nginx    ] ⺠⬤  debug     Could not delete file: {
  "errno": -2,
  "syscall": "unlink",
  "code": "ENOENT",
  "path": "/data/nginx/proxy_host/3.conf.err"
}

What I tested to configure from the UI is just "host:8080"

Thansk for support,

@zpaul91
Copy link

zpaul91 commented Oct 4, 2023

I fixed the feature by modifying the template of _listen.conf

{% if not listen_ports %}
    listen 80;
    {% if ipv6 -%}
      listen [::]:80;
    {% else -%}
      #listen [::]:80;
    {% endif %}
    {% if certificate -%}
      listen 443 ssl{% if http2_support %} http2{% endif %};
    {% if ipv6 -%}
      listen [::]:443 ssl{% if http2_support %} http2{% endif %};
    {% else -%}
      #listen [::]:443;
    {% endif %}
    {% endif %}
{% endif %}
{% for listen_port in listen_ports %}
      {% if certificate -%}
        listen {{ listen_port }} ssl{% if http2_support %} http2{% endif %};
          {% if ipv6 -%}
            listen [::]:{{ listen_port }} ssl{% if http2_support %} http2{% endif %};
          {% endif %}
      {% else %}
          listen {{ listen_port }};
          {% if ipv6 -%}
            listen [::]:{{ listen_port }};
          {% endif %}
      {% endif %}
{% endfor %}
  server_name {{ domain_names | join: " " }};

I guess it's what many of us wanted, could you add it to your pull request?

Copy link

PR is now considered stale. If you want to keep it open, please comment 👍

@github-actions github-actions bot added the stale label Apr 18, 2024
@nginxproxymanagerci
Copy link

CI Error:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
certbot-node: Pulling from nginxproxymanager/nginx-full
Digest: sha256:eaa2ebcb50dd87557c9a8f95a3230128d94cac1ea17800261c036e59378e7d49
Status: Image is up to date for nginxproxymanager/nginx-full:certbot-node
docker.io/nginxproxymanager/nginx-full:certbot-node
�[1;34m❯ �[1;36mBuilding Frontend ...�[0m
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/tabler/tabler.git /usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309
Directory: /app/frontend
Output:
Cloning into '/usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 410 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@github-actions github-actions bot removed the stale label Nov 14, 2024
Copy link

PR is now considered stale. If you want to keep it open, please comment 👍

@github-actions github-actions bot added the stale label Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants