Reverse proxy to iRedMail using ngnix

1. The problem I’m having:

Stuck introducing reverse proxy to iRedMail using ngix. Background: I have a successful install on server 1 using Caddy serving several webpages, a mattermost application. What I’m trying to do now. I’ve created server2 installed iRedMail and it uses NGNIX and works well. Now I’d like to migrate server 1 functionality existing to server 2. I’ve change NGIX iRedMail port from 80 to 8081 and restarted ngnix and service status shows running. I’ve setup CaddyFile as reverse proxy using server ip and 127.0.0.1. When I try to access https://ryc-maine.org it does generate a log that I’ve attached. Once I get this running I’ll start migrating some of the other services from server1. I’d like some help on what I should change next to get mail working through the reverse proxy. Thank You! Russ

One other note when I add debug to the caddy file it does not generate the log file. maybe that sends somewhere else then, I’m not sure.

2. Error messages and/or full log output:

When I go to https://ryc-maine.org

Results of /var/log/caddy/iRedMail.log
root@mail:/var/log/caddy# cat iRedMail.log

{"level":"info","ts":1682177459.952491,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.001068858,"size":162,"status":301,"resp_headers":{"X-Frame-Options":["sameorigin"],"Server":["Caddy","nginx"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Content-Type-Options":["nosniff"],"Date":["Sat, 22 Apr 2023 15:30:59 GMT"],"Location":["https://ryc-maine.org/"],"Content-Length":["162"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"X-Permitted-Cross-Domain-Policies":["none"],"Referrer-Policy":["strict-origin"],"X-Download-Options":["noopen"],"X-Xss-Protection":["1; mode=block"],"Content-Type":["text/html"]}}

{"level":"info","ts":1682177460.0509942,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000847921,"size":162,"status":301,"resp_headers":{"X-Xss-Protection":["1; mode=block"],"X-Frame-Options":["sameorigin"],"Location":["https://ryc-maine.org/"],"X-Content-Type-Options":["nosniff"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Permitted-Cross-Domain-Policies":["none"],"Content-Type":["text/html"],"Content-Length":["162"],"X-Download-Options":["noopen"],"Server":["Caddy","nginx"],"Referrer-Policy":["strict-origin"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"]}}

{"level":"info","ts":1682177460.1499925,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000420093,"size":162,"status":301,"resp_headers":{"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"Referrer-Policy":["strict-origin"],"X-Permitted-Cross-Domain-Policies":["none"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Location":["https://ryc-maine.org/"],"X-Xss-Protection":["1; mode=block"],"X-Frame-Options":["sameorigin"],"Content-Length":["162"],"X-Download-Options":["noopen"],"Server":["Caddy","nginx"],"Content-Type":["text/html"],"X-Content-Type-Options":["nosniff"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"]}}

{"level":"info","ts":1682177460.2304063,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000640228,"size":162,"status":301,"resp_headers":{"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"Content-Type":["text/html"],"Referrer-Policy":["strict-origin"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["162"],"X-Content-Type-Options":["nosniff"],"Location":["https://ryc-maine.org/"],"X-Permitted-Cross-Domain-Policies":["none"],"X-Download-Options":["noopen"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"X-Frame-Options":["sameorigin"],"Server":["Caddy","nginx"],"Alt-Svc":["h3=\":443\"; ma=2592000"]}}

{"level":"info","ts":1682177460.3218918,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000565209,"size":162,"status":301,"resp_headers":{"X-Xss-Protection":["1; mode=block"],"X-Download-Options":["noopen"],"X-Frame-Options":["sameorigin"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"X-Permitted-Cross-Domain-Policies":["none"],"Server":["Caddy","nginx"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/html"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Content-Length":["162"],"Location":["https://ryc-maine.org/"],"Referrer-Policy":["strict-origin"]}}

{"level":"info","ts":1682177460.40109,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000601067,"size":162,"status":301,"resp_headers":{"Content-Length":["162"],"Referrer-Policy":["strict-origin"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Location":["https://ryc-maine.org/"],"X-Frame-Options":["sameorigin"],"X-Xss-Protection":["1; mode=block"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"Server":["Caddy","nginx"],"X-Download-Options":["noopen"],"Content-Type":["text/html"],"X-Content-Type-Options":["nosniff"],"X-Permitted-Cross-Domain-Policies":["none"]}}

{"level":"info","ts":1682177460.5095534,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000436459,"size":162,"status":301,"resp_headers":{"Content-Length":["162"],"Referrer-Policy":["strict-origin"],"Server":["Caddy","nginx"],"X-Content-Type-Options":["nosniff"],"X-Download-Options":["noopen"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"X-Permitted-Cross-Domain-Policies":["none"],"Content-Type":["text/html"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Xss-Protection":["1; mode=block"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"Location":["https://ryc-maine.org/"],"X-Frame-Options":["sameorigin"]}}

{"level":"info","ts":1682177460.5906734,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000506195,"size":162,"status":301,"resp_headers":{"Referrer-Policy":["strict-origin"],"X-Download-Options":["noopen"],"Server":["Caddy","nginx"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Permitted-Cross-Domain-Policies":["none"],"Content-Length":["162"],"X-Xss-Protection":["1; mode=block"],"X-Frame-Options":["sameorigin"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"Location":["https://ryc-maine.org/"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/html"]}}

{"level":"info","ts":1682177460.6695936,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000580409,"size":162,"status":301,"resp_headers":{"Referrer-Policy":["strict-origin"],"X-Xss-Protection":["1; mode=block"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Content-Type":["text/html"],"Location":["https://ryc-maine.org/"],"X-Permitted-Cross-Domain-Policies":["none"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"X-Download-Options":["noopen"],"X-Frame-Options":["sameorigin"],"X-Content-Type-Options":["nosniff"],"Server":["Caddy","nginx"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Content-Length":["162"]}}

{"level":"info","ts":1682177460.7501376,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.00094303,"size":162,"status":301,"resp_headers":{"X-Download-Options":["noopen"],"Referrer-Policy":["strict-origin"],"Server":["Caddy","nginx"],"Location":["https://ryc-maine.org/"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"X-Xss-Protection":["1; mode=block"],"X-Frame-Options":["sameorigin"],"X-Permitted-Cross-Domain-Policies":["none"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/html"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"Content-Length":["162"]}}

{"level":"info","ts":1682177460.8297856,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000621627,"size":162,"status":301,"resp_headers":{"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Referrer-Policy":["strict-origin"],"Content-Type":["text/html"],"X-Download-Options":["noopen"],"Server":["Caddy","nginx"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Xss-Protection":["1; mode=block"],"Location":["https://ryc-maine.org/"],"X-Content-Type-Options":["nosniff"],"Content-Length":["162"],"X-Frame-Options":["sameorigin"],"X-Permitted-Cross-Domain-Policies":["none"]}}

{"level":"info","ts":1682177460.9108117,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000702254,"size":162,"status":301,"resp_headers":{"Content-Length":["162"],"X-Permitted-Cross-Domain-Policies":["none"],"Referrer-Policy":["strict-origin"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"X-Xss-Protection":["1; mode=block"],"X-Frame-Options":["sameorigin"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Location":["https://ryc-maine.org/"],"Content-Type":["text/html"],"X-Download-Options":["noopen"],"X-Content-Type-Options":["nosniff"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Server":["Caddy","nginx"]}}

{"level":"info","ts":1682177460.9902136,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000750103,"size":162,"status":301,"resp_headers":{"Server":["Caddy","nginx"],"Date":["Sat, 22 Apr 2023 15:31:00 GMT"],"X-Content-Type-Options":["nosniff"],"X-Download-Options":["noopen"],"X-Frame-Options":["sameorigin"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Content-Length":["162"],"Location":["https://ryc-maine.org/"],"X-Xss-Protection":["1; mode=block"],"X-Permitted-Cross-Domain-Policies":["none"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Content-Type":["text/html"],"Referrer-Policy":["strict-origin"]}}

{"level":"info","ts":1682177461.071064,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000583119,"size":162,"status":301,"resp_headers":{"X-Content-Type-Options":["nosniff"],"X-Download-Options":["noopen"],"Content-Length":["162"],"Server":["Caddy","nginx"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Permitted-Cross-Domain-Policies":["none"],"Content-Type":["text/html"],"X-Frame-Options":["sameorigin"],"Location":["https://ryc-maine.org/"],"X-Xss-Protection":["1; mode=block"],"Date":["Sat, 22 Apr 2023 15:31:01 GMT"],"Referrer-Policy":["strict-origin"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"]}}

{"level":"info","ts":1682177461.1689973,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.58.223.160","remote_port":"21401","proto":"HTTP/2.0","method":"GET","host":"ryc-maine.org","uri":"/","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.9"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"ryc-maine.org"}},"user_id":"","duration":0.000786456,"size":162,"status":301,"resp_headers":{"Referrer-Policy":["strict-origin"],"X-Download-Options":["noopen"],"Content-Length":["162"],"Date":["Sat, 22 Apr 2023 15:31:01 GMT"],"Content-Security-Policy":["default-src https: data: 'unsafe-inline' 'unsafe-eval'"],"Server":["Caddy","nginx"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Permitted-Cross-Domain-Policies":["none"],"X-Xss-Protection":["1; mode=block"],"X-Frame-Options":["sameorigin"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/html"],"Location":["https://ryc-maine.org/"]}}

3. Caddy version:

v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=

4. How I installed and ran Caddy:

curl -1sLf ‘https://dl.cloudsmith.io/public/caddy/stable/gpg.key’ | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf ‘https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt’ | sudo tee /etc/apt/sources.list.d/caddy-stable.list
apt update
apt install caddy

a. System environment:

Fresh server install on kamatera
root@mail:/var/log/caddy# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
root@mail:/var/log/caddy# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) Platinum 8358P CPU @ 2.60GHz
stepping : 2
microcode : 0xd000311
cpu MHz : 2593.905
cache size : 49152 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm pti ssbd ibrs ibpb stibp tsc_adjust arat md_clear flush_l1d arch_capabilities
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown retbleed
bogomips : 5187.81
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 57 bits virtual
power management:

b. Command:

systemctl enable caddy
systemctl stop caddy
systemctl status caddy.service

d. My complete Caddy config:

ryc-maine.org {
	reverse_proxy 127.0.0.1:8081
        log {
            output file /var/log/caddy/iRedMail.log
        }
}

5. Links to relevant resources:

Looks like it’s stuck in a redirect loop. Make sure your upstream app isn’t trying to redirect HTTP to HTTPS.

Yes, debug logs are written to stdout. See the docs for how to see your logs:

Thanks! That seemed to do it. I’ve commented out the redirect in configuration file and restarted ngnix then Caddy. No errors and I get a ngnix page on web load.

Thanks for the tip!!!

Russ

1 Like

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