What's the easiest way to return a 404? #1824
Answered
by
darrylmorley
darrylmorley
asked this question in
Q&A
-
As per the title, is there a quick and easy way to return a 404 from Caprover? Background: Our domain was hijacked by a spammer who created a huge amount of URLs across several subdomains. I need to return a 404 for those subdomains to get them off Google. |
Beta Was this translation helpful? Give feedback.
Answered by
darrylmorley
Aug 1, 2023
Replies: 1 comment 1 reply
-
Probably the easiest is to add the list to your application code, and programmatically check for those URLs and return 404 from your application. Then nginx will just forward that 404 to the client. If you prefer to do it in nginx, you'll be slightly more challenging. You'll have to modify the nginx configuration by adding blocks like this:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It sounds like the easiest way would be with Nginx, bearing in mind this is subdomains, not URLs. I could return 404 for everything.
Thanks.