1. The problem I’m having:
I am trying to reverse proxy a golang server (http not https) hosted on a windows server in my local network. I need to translate from dns subdomain (dadjoke.pootwaddle.com) to a go server that serves at the location http://192.168.106.253:9999/dadjoke, and will also have static assets like css, favicon, etc.
Ultimately, I want Caddy to be the terminator for TLS, accept tls and provide certificates to the WAN portion of my setup, but use just http inside my LAN, unless I need to enable it for a site I am proxying.
That’s an ultimate wish, but if I need to change configurations around my go app, then so be it.
2. Error messages and/or full log output:
Error: adapting config using caddyfile: Caddyfile:11: unrecognized directive: auto_https
3. Caddy version:
v2.7.4 h1:J8nisjdOxnYHXlorUKXY75Gr6iBfudfoGhrJ8t7/flI=
4. How I installed and ran Caddy:
Installed using sudo apt install caddy, and also debian-keyring debian-archive-keyring apt-transport-https
a. System environment:
This is a virtual machine of ubuntu
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
b. Command:
used caddy start as root from within a folder with my Caddyfile, and
have been making incremental changes and testing as I go using
root@webbby:/home/bjarvis/caddy# caddy reload
2023/08/29 15:11:53.903 INFO using adjacent Caddyfile
Error: adapting config using caddyfile: Caddyfile:11: unrecognized directive: auto_https
root@webbby:/home/bjarvis/caddy#
c. Service/unit/compose file:
d. My complete Caddy config:
{
debug
}
thesingingscoutmaster.com, 192.168.106.141 {
root * /var/www/singing
file_server
}
dadjoke.pootwaddle.com {
auto_https off
reverse_proxy /dadjoke http://192.168.106.253:9999
reverse_proxy /static http://192.168.106.253:9999
file_server
}
5. Links to relevant resources:
This is a portion of my nginx configuration that seems to work “ok”
server {
listen 443 ssl http2;
server_name dadjoke.pootwaddle.com;
access_log /var/log/nginx/dadjoke.pootwaddle.com.log custom;
error_log /var/log/nginx/dadjoke.pootwaddle.com.err.log notice;
include snippets/pootwaddle.com.cert.conf;
include snippets/ssl-params.conf;
location / {
include snippets/proxy-params.conf;
proxy_pass http://192.168.106.253:9999/dadjoke;
}
location /dadjoke {
include snippets/proxy-params.conf;
proxy_pass http://192.168.106.253:9999;
}
location /static {
include snippets/proxy-params.conf;
proxy_pass http://192.168.106.253:9999/static;
}
}