Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: configurable external ports by vhost#2678

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
buchdag wants to merge5 commits intomain
base:main
Choose a base branch
Loading
fromconfigurable-external-ports-by-host

Conversation

@buchdag
Copy link
Member

@buchdagbuchdag commentedNov 15, 2025
edited
Loading

services:synapse:environment:VIRTUAL_HOST_MULTIPORTS:|-        example.org:          exernal_https_port: 8448          "/":            port: 8448          "/path"        matrix.example.org:          "/":            port: 8080
  • https://example.org:8448 =>synapse:8448
  • https://example.org:8448/path =>synapse:80
  • https://matrix.example.org =>synapse:8080

external_http_port and / orexternal_https_port can be defined at the virtual host level, and will be used for all of the virtual paths of this virtual host.

For containers that don't useVIRTUAL_HOST_MULTIPORTS, two new environment variables serve the same purpose :EXTERNAL_HTTP_PORT andEXTERNAL_HTTPS_PORT, ie:

services:synapse:environment:VIRTUAL_HOST:"example.org"VIRTUAL_PORT:"8448"EXTERNAL_HTTPS_PORT:"8448"
  • https://example.org:8448 =>synapse:8448

@buchdagbuchdag self-assigned thisNov 15, 2025
Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR adds support for configurable external HTTP and HTTPS ports on a per-virtual-host basis. Previously, external ports were globally configured; now they can be overridden per vhost usingEXTERNAL_HTTP_PORT andEXTERNAL_HTTPS_PORT environment variables or via theVIRTUAL_HOST_MULTIPORTS configuration.

Key changes:

  • Added per-vhost external port configuration in nginx template
  • Created comprehensive test suite for single-host and multi-port scenarios
  • Modified template to use vhost-specific ports in listen directives and redirects

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
nginx.tmplModified to extract and store per-vhost external port configurations from environment variables, and use them in server listen directives and redirect URIs
test/test_external-ports/test_virtual-host.ymlTest configuration for four scenarios: custom http+https ports, custom https only, custom http only, and default ports
test/test_external-ports/test_virtual-host.pyTest assertions verifying correct port usage in redirects for single-host scenarios
test/test_external-ports/test_virtual-host-multiport.ymlTest configuration for multi-port virtual hosts with various port configurations
test/test_external-ports/test_virtual-host-multiport.pyTest assertions verifying correct port usage for multi-port virtual hosts including subpaths
test/test_external-ports/compose.base.override.ymlDocker compose override exposing the custom ports for testing
test/test_external-ports/certs/nginx-proxy.tld.keySSL private key for test certificate
test/test_external-ports/certs/nginx-proxy.tld.crtSSL certificate for testing HTTPS functionality

💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

Copy link
Contributor

@p12ticp12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

+1 more reviewer

@p12ticp12ticp12tic left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

@buchdagbuchdag

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@buchdag@p12tic

[8]ページ先頭

©2009-2025 Movatter.jp