NGINX /etc/nginx/http.d/default.conf

Original ๐Ÿ“‹ Alpine Linux v3.21 17 lines

Works On

Viewing:
Alpine Linux v3.21
Same on:
Other versions:

Details

Size
17 lines
MD5
c4759cd2812220ab542317f54fbbe755
SHA256
f53fd49af9b4bc308653abb85d9989879ce1fb48e43c508f5f45c84f74513865

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/c4759cd2812220ab542317f54fbbe755?hint=default.conf
wget:
wget -O default.conf https://exampleconfig.com/api/v1/config/original/c4759cd2812220ab542317f54fbbe755?hint=default.conf

For AI Agents

You are a DevOps agent. Fetch the default NGINX config for Alpine Linux v3.21 from https://exampleconfig.com/api/v1/config/original/c4759cd2812220ab542317f54fbbe755?hint=default.conf. Compare with my current /etc/nginx/http.d/default.conf and summarize differences and safe changes.

Copy this prompt into Claude, ChatGPT, or other AI assistants.

/etc/nginx/http.d/default.conf
# This is a default site configuration which will simply return 404, preventing
# chance access to any other virtualhost.

server {
	listen 80 default_server;
	listen [::]:80 default_server;

	# Everything is a 404
	location / {
		return 404;
	}

	# You may need this to prevent return 404 recursion.
	location = /404.html {
		internal;
	}
}

Install NGINX

Alpine Linux

sudo apk add nginx

Debian

sudo apt update && sudo apt install nginx

Red Hat Enterprise Linux

sudo yum install nginx

Ubuntu

sudo apt update && sudo apt install nginx

File Location

File Path
/etc/nginx/http.d/default.conf
Directory
/etc/nginx/http.d/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

When should I use this default.conf?

Restore it. Compare it. Start clean.

How do I restore NGINX defaults?

Download, replace, restart.

Is default.conf safe for production?

Yes. This is exactly what shipped. Safe starting point.

How does this differ from other OS versions?

Defaults change. This one is specific to Alpine Linux v3.21.

Can I use this for NGINX troubleshooting?

Absolutely. Diff this against yours to spot the problem.