Can i config two app with http and https listening same port?

1. The problem I’m having:

I want to config two app one http, another https and listen on same port. How to config?

2. Error messages and/or full log output:

server listening on [:8443] is configured for HTTPS and cannot natively multiplex HTTP and HTTPS

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

3. Caddy version:

v2

4. How I installed and ran Caddy:

a. System environment:

b. Command:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

c. Service/unit/compose file:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

d. My complete Caddy config:

https://localhost:8080 {
	respond "hello world https"
	
}

http://localhost:8080 {
	respond "hello world http"
	
}
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

5. Links to relevant resources:

You cannot use two different protocols using the same port.

You can use subdomains or other kinds of request matchers to disambiguate requests on the same protocol.

ok. thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.