1. Caddy version (caddy version
):
v2.1.1 h1:X9k1+ehZPYYrSqBvf/ocUgdLSRIuiNiMo7CvyGUQKeA=
2. How I run Caddy:
a. System environment:
Virtual machine:
4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux
b. Command:
caddy run --watch
d. My complete Caddyfile or JSON config:
pubserv.toets.co.za intserv.toets.co.za jetaddzero.toets.co.za
root * /usr/share/caddy
file_server
log {
format console
output stdout
}
tls /etc/letsencrypt/live/pubserv.toets.co.za/fullchain.pem /etc/letsencrypt/live/pubserv.toets.co.za/privkey.pem
reverse_proxy /test.cgi {
to unix//run/fcgiwrap.socket
transport fastcgi {
root /usr/local/bin
split .cgi
}
}
3. The problem I’m having:
I’m trying to see the errors that fcgiwrap emits (using it’s -f
parameter) back on the fastcgi Unix socket on the Caddy side
Combined log in Caddy2 + error log question refers, as that haven’t been answered it seemed ?
4. Error messages and/or full log output:
5. What I already tried:
hvisage@jetaddzero ~ % curl https://pubserv.toets.co.za/test.cgi
403 Forbidden
2020/08/16 14:45:03.685 INFO watcher watching config file for changes {"config_file": "Caddyfile"}
2020/08/16 16:45:03 [INFO][cache:0xc0002474a0] Started certificate maintenance routine
1.5975891084600637e+09 error http.log.access.log0 handled request {"request": {"method": "GET", "uri": "/test.cgi", "proto": "HTTP/2.0", "remote_addr": "[fd12:ac4a:1e71:d241:3999:9360:3804:8e5e]:34606", "host": "pubserv.toets.co.za", "headers": {"User-Agent": ["curl/7.64.0"], "Accept": ["*/*"]}, "tls": {"resumed": false, "version": 772, "ciphersuite": 4867, "proto": "h2", "proto_mutual": true, "server_name": "pubserv.toets.co.za"}}, "common_log": "fd12:ac4a:1e71:d241:3999:9360:3804:8e5e - - [16/Aug/2020:16:45:08 +0200] \"GET /test.cgi HTTP/2.0\" 403 15",
"duration": 0.008544152, "size": 15, "status": 403, "resp_headers": {"Server": ["Caddy"], "Status": ["403 Forbidden"], "Content-Type": ["text/plain"]}}
accept(0, {sa_family=AF_UNIX}, [112->2]) = 3
poll([{fd=3, events=POLLIN}], 1, 2000) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\1\0\1\0\10\0\0\0\1\0\0\0\0\0\0", 8192) = 16
read(3, "\1\4\0\1\2\357\1\0\v'REMOTE_HOSTfd12:ac4a:1e71:d241:3999:9360:3804:8e5e\t\23HTTP_HOSTpubserv.toets.co.za\17\vHTTP_USER_AGENTcurl/7.64.0\24'HTTP_X_FORWARDED_FORfd12:ac4a:1e71:d241:3999:9360:3804:8e5e\t\0AUTH_TYPE\v\0REMOTE_USER\v\5REMOTE_PORT34606\26\5HTTP_X_FORWARDED_PROTOhttps\17\27SCRIPT_FILENAME/usr/local/bin/test.cgi\t\0PATH_INFO\v\0SERVER_PORT\17\10SERVER_PROTOCOLHTTP/2.0\v\tSCRIPT_NAME/test.cgi\v\23SERVER_NAMEpubserv.toets.co.za\v\tREQUEST_URI/test.cgi\f\7SSL_PROTOCOLTLSv1.3\f\0REMOTE_IDENT\16\1CONTENT_LENGTH0\f\tDOCUMENT_URI/test.cgi\n\34SSL_CIPHERTLS_CHACHA20_POLY1305_SHA256\21\7GATEWAY_INTERFACECGI/1.1\f\0QUERY_STRING\r\16DOCUMENT_ROOT/usr/local/bin\5\2HTTPSon\v\3HTTP_ACCEPT*/*\v'REMOTE_ADDRfd12:ac4a:1e71:d241:3999:9360:3804:8e5e\17\fSERVER_SOFTWARECaddy/v2.1.1\16\5REQUEST_SCHEMEhttps\f\0CONTENT_TYPE\16\3REQUEST_METHODGET\0", 8192) = 760
read(3, "\1\4\0\1\0\0\0\0", 8192) = 8
pipe([4, 5]) = 0
pipe([6, 7]) = 0
pipe([8, 9]) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f31d0ef1a90) = 4790
close(4) = 0
close(7) = 0
close(9) = 0
read(3, "\1\5\0\1\0\0\0\0", 8192) = 8
close(5) = 0
select(9, [6 8], NULL, NULL, NULLstrace: Process 4790 attached
<unfinished ...>
[pid 4790] set_robust_list(0x7f31d0ef1aa0, 24) = 0
[pid 4790] close(5) = 0
[pid 4790] close(6) = 0
[pid 4790] close(8) = 0
[pid 4790] dup2(4, 0) = 0
[pid 4790] dup2(7, 1) = 1
[pid 4790] dup2(9, 2) = 2
[pid 4790] close(4) = 0
[pid 4790] close(7) = 0
[pid 4790] close(9) = 0
[pid 4790] close(-1) = -1 EBADF (Bad file descriptor)
[pid 4790] rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[CHLD], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f31d10fb840}, {sa_handler=SIG_IGN, sa_mask=[CHLD], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f31d10fb840}, 8) = 0
[pid 4790] rt_sigaction(SIGPIPE, {sa_handler=SIG_DFL, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f31d10fb840}, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f31d10fb840}, 8) = 0
[pid 4790] lstat("/usr/local/bin/test.cgi", 0x7ffdb5a43c90) = -1 ENOENT (No such file or directory)
[pid 4790] fstat(1, {st_dev=makedev(0, 0xc), st_ino=1390500, st_mode=S_IFIFO|0600, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=0, st_atime=1597589108 /* 2020-08-16T16:45:08.450491005+0200 */, st_atime_nsec=450491005, st_mtime=1597589108 /* 2020-08-16T16:45:08.450491005+0200 */, st_mtime_nsec=450491005, st_ctime=1597589108 /* 2020-08-16T16:45:08.450491005+0200 */, st_ctime_nsec=450491005}) = 0
[pid 4790] write(1, "Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n", 66 <unfinished ...>
[pid 4537] <... select resumed> ) = 1 (in [6])
[pid 4790] <... write resumed> ) = 66
[pid 4537] read(6, "Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n", 4096) = 66
[pid 4537] select(9, [6 8], NULL, NULL, NULL <unfinished ...>
[pid 4790] write(2, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 112 <unfinished ...>
[pid 4537] <... select resumed> ) = 1 (in [8])
[pid 4790] <... write resumed> ) = 112
[pid 4537] read(8, "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?", 4096) = 112
[pid 4537] select(9, [6 8], NULL, NULL, NULL <unfinished ...>
[pid 4790] write(2, "\n", 1 <unfinished ...>
[pid 4537] <... select resumed> ) = 1 (in [8])
[pid 4790] <... write resumed> ) = 1
[pid 4537] read(8, "\n", 4096) = 1
[pid 4537] select(9, [6 8], NULL, NULL, NULL <unfinished ...>
[pid 4790] exit_group(99) = ?
[pid 4537] <... select resumed> ) = 1 (in [8])
[pid 4537] read(8, "", 4096) = 0
[pid 4537] close(8) = 0
[pid 4537] select(9, [6], NULL, NULL, NULL) = 1 (in [6])
[pid 4537] read(6, "", 4096) = 0
[pid 4537] close(6) = 0
[pid 4537] write(3, "\1\7\0\1\0q\7\0Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?\n\0\0\0\0\0\0\0\1\7\0\1\0\0\0\0", 136) = 136
[pid 4537] write(3, "\1\6\0\1\0B\6\0Status: 403 Forbidden\r\nContent-Type: text/plain\r\n\r\n403 Forbidden\r\n\0\0\0\0\0\0\1\6\0\1\0\0\0\0\1\3\0\1\0\10\0\0\0\0\0\0\0\0\0\0", 104) = 104
[pid 4537] shutdown(3, SHUT_WR) = 0
[pid 4537] poll([{fd=3, events=POLLIN}], 1, 2000) = 1 ([{fd=3, revents=POLLIN|POLLERR|POLLHUP}])
[pid 4537] read(3, 0x7ffdb5a438b0, 1024) = -1 ECONNRESET (Connection reset by peer)
[pid 4537] close(3) = 0
[pid 4537] accept(0, <unfinished ...>
[pid 4790] +++ exited with 99 +++
<... accept resumed> 0x7ffdb5a43c50, [112]) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
accept(0,