Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple redirect to custom 404.html (static site) #630

Open
moritzlaube opened this issue Jun 7, 2024 · 0 comments
Open

Simple redirect to custom 404.html (static site) #630

moritzlaube opened this issue Jun 7, 2024 · 0 comments

Comments

@moritzlaube
Copy link

Hey! Im am simply trying to redirect to a 404 page (404.html) when the requested resource doesn't exist. This is my current (working - without the redirect) config:

caddy_0.encode=zstd gzip
caddy_0.handle_path.0_reverse_proxy={{upstreams 80}}
caddy_0.handle_path=/*
caddy_0.header=-Server
caddy_0.try_files={path} /index.html
caddy_0=https://example.com
caddy_1=https://www.example.com
caddy_1.redir=https://example.com
caddy_ingress_network=coolify

I have tried:

caddy_0.encode=zstd gzip
caddy_0.handle_path.0_reverse_proxy={{upstreams 80}}
caddy_0.handle_path=/*
caddy_0.header=-Server
caddy_0.try_files={path} {path}/ =404
caddy_0.handle_errors.0_rewrite=* /404.html
caddy_0.handle_errors.0_templates
caddy_0.handle_errors.0_file_server
caddy_0=https://example.com/
caddy_1=https://www.example.com/
caddy_1.redir=https://example.com/ permanent
caddy_ingress_network=coolify

... but with no luck. I know, it's not an issue. It's a question and I am quite desperately looking for help. Thanks in advance! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant