Logout system 404 HTTP status

1. Output of caddy version:

v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=

2. How I run Caddy:

a. System environment:

CentOS7

b. Command:

systemctl start caddy

c. Service/unit/compose file:

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

d. My complete Caddy config:

(handle_info_log) {
	log {
		output file /var/log/caddy/info.log {
                   
                    roll_size 100MiB

                    roll_keep_for 30d

                    #roll_local_time
                
                }
                
                format console {

                  time_format wall

                  time_local
                
                }

		level INFO
             
	}
}

(handle_error_log) {
        log {
                output file /var/log/caddy/error.log {

                    roll_size 30MiB

                    roll_keep_for 30d

                    #roll_local_time

                }

                format console {

                  time_format wall

                  time_local

                }

                level ERROR

        }
}

(handle_errors) {
	handle_errors {

	     rewrite * /{err.status_code}.html

	     file_server
	}
}

www.tigerice.cn {

	encode gzip

	import handle_errors

        import handle_info_log
        
        import handle_error_log


        handle_path /merchant/* {

            root * /opt/twomicro_v2/web/merchant

            file_server

        }

        handle_path /torna/* {

            root * /opt/twomicro_v2/web/torna

            file_server

        }

        handle_path /dingding/* {

            root * /opt/twomicro_v2/web/dingding

            file_server

        }


        handle_path /formmaking/* {

            root * /opt/twomicro_v2/web/dist
            
            file_server

        }

        @nacos path /nacos*
	reverse_proxy @nacos {
		header_up Host {http.reverse_proxy.upstream.hostport}
		header_down Access-Control-Allow-Origin *
		header_down Access-Control-Allow-Methods GET,POST,OPTIONS
		header_down Access-Control-Allow-Headers X-Requested-With
                to http://127.0.0.1:8848
	}

	reverse_proxy /demo-framework/* {
		header_down Access-Control-Allow-Origin *
		header_down Access-Control-Allow-Methods GET,POST,OPTIONS
		header_down Access-Control-Allow-Headers X-Requested-With
		to localhost:8081
	}

	reverse_proxy /demo-example/* {
		to localhost:8081
	}

}

3. The problem I’m having:

Login to the web system succeeded, but logout failed. HTTP status 404.

4. Error messages and/or full log output:

curl -v https://www.tigerice.cn/merchant/user/login?redirect=%2Ftorna%2F

* About to connect() to www.tigerice.cn port 443 (#0)
*   Trying 43.143.173.96...
* Connected to www.tigerice.cn (43.143.173.96) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* 	subject: CN=www.tigerice.cn
* 	start date: Nov 17 11:33:09 2022 GMT
* 	expire date: Feb 15 11:33:08 2023 GMT
* 	common name: www.tigerice.cn
* 	issuer: CN=R3,O=Let's Encrypt,C=US
> GET /merchant/user/login?redirect=%2Ftorna%2F HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.tigerice.cn
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Alt-Svc: h3=":443"; ma=2592000
< Server: Caddy
< Date: Fri, 25 Nov 2022 08:14:01 GMT
< Content-Length: 0
< 
* Connection #0 to host www.tigerice.cn left intact

curl -v https://www.tigerice.cn/merchant/user/login

* About to connect() to www.tigerice.cn port 443 (#0)
*   Trying 43.143.173.96...
* Connected to www.tigerice.cn (43.143.173.96) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* 	subject: CN=www.tigerice.cn
* 	start date: Nov 17 11:33:09 2022 GMT
* 	expire date: Feb 15 11:33:08 2023 GMT
* 	common name: www.tigerice.cn
* 	issuer: CN=R3,O=Let's Encrypt,C=US
> GET /merchant/user/lo HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.tigerice.cn
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Alt-Svc: h3=":443"; ma=2592000
< Server: Caddy
< Date: Fri, 25 Nov 2022 08:14:06 GMT
< Content-Length: 0
< 
* Connection #0 to host www.tigerice.cn left intact

5. What I already tried:

First , i fixed regular expression, but the directive handle_path can only math /merchant* or /merchant/*, i will try handle

6. Links to relevant resources:

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