---
title: "Discussion on \"Nginx catch-all config for http:// and https://\" | Hashnode"
description: "Discussion on \"Nginx catch-all config for http:// and https://\". Catch-all for Port 80 (http://)\n\nserver {\n   listen 80 default_server; \n   server_name _;\n   return 404;\n}\n\nCatch-all for Port 443 (https://)\nFirst generate a self signed cert:\nopenssl req -nodes -x509 -newkey rsa:4096 -keyout self_key.pem -out self_..."
url: "https://hashnode.com/posts/nginx-catch-all-config-for-http-and-https/6565a50d48835e2ab34c7b1c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Nginx catch-all config for http:// and https://](https://shrwn.com.np/nginx-catch-all-config-for-http-and-https?utm_source=hashnode&utm_medium=feed)

Catch-all for Port 80 (http://) server { listen 80 default\_server; server\_name \_; return 404; } Catch-all for Port 443 (https://) First generate a self signed cert: openssl req -nodes -x509 -newkey rsa:4096 -keyout self\_key.pem -out self\_...

Nov 28, 2023 · 1 min read · shrwn.com.np  
Read the article

-   [#nginx](https://hashnode.com/tag/nginx)

## Written by

[Shrawan Poudel](https://hashnode.com/@shrawanx)

@shrawanx · Kathmandu, Nepal

  
[View profile](https://hashnode.com/@shrawanx)

shrawanx.com

Working on mission to provide, Software Engineering Trainings easily and freely accessible to everyone through EdTech

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
