r/nginx

▲ 5 r/nginx

Index files don't load,

Yes i have read the beginners guide and tried troubleshooting based on the ancient wisdom of stackoverflow. My configuration file should be fine but im sure i have missed something because otherwise things would be working properly. Regardless of whether or not i specify an index.html, none of the index files of any subdirectories load at all. No 404, nothing in error logs, they just don't load and my browser times out. The home page loads just fine and all fonts and images referenced in its index file are shown correctly. If i try to access the index file directly (music/index.html) it works. What's going on?

http {

types {

text/css css;

text/html html;

}

server {

error_log /var/log/nginx/error.log;

root /srv/katieglinda;

listen 8081;

# Home Page

location / {

include /etc/nginx/mime.types;

root /srv/katieglinda;

}

# Other Pages

location /music/ {

root /srv/katieglinda;

}

location /minecraft/ {

root /srv/katieglinda;

}

location /stuff/ {

root /srv/katieglinda;

index index.html;

}

location /about/ {

root /srv/katieglinda;

index index.html;

}

# Resources

location /fonts {

root /srv/katieglinda;

}

location /images {

root /srv/katieglinda;

}

}

}

reddit.com
u/OhFuckThatWasDumb — 2 days ago
▲ 0 r/nginx

Do you run nginx -t against source files or the image you actually deploy?

nginx -t does exactly what it promises. The subtle failure mode is running a valid check against something other than the artifact that reaches production.

A pipeline can test repository files with the runner's Nginx package, then deploy an image with a different build, module set, filesystem layout, generated config, user, and network. The command is the same; the thing being tested is not.

These are the parity checks I find useful:

  1. Binary fingerprint Capture nginx -V from the deployable image, not just the CI runner. Version numbers are not enough when configure arguments and dynamic modules differ.

  2. Rendered configuration Run the test after the normal template or envsubst step. Testing the source template proves little if the deployed file is generated later. nginx -T is useful for confirming the final include graph, but its output should be treated as sensitive when rendered values contain credentials.

  3. Runtime identity and filesystem Use the same UID, mounts, working prefix, read-only paths, certificates, and generated directories as the deployment. A permissive runner can hide restrictions that only exist in the container or host.

  4. Network-dependent behavior A parser check is not a request test. Resolver behavior, service discovery, upstream failures, headers, redirects, and location selection still need representative traffic in a deployment-like network.

At minimum, I want these commands to run inside the built image after its normal rendering step:

nginx -V 2>&1
nginx -t -c /etc/nginx/nginx.conf

Disclosure: I build and maintain the Nginx Configuration plugins for JetBrains IDEs. They help with directive context, includes, references, and risky patterns while editing; this deployment boundary is deliberately outside what an IDE can prove.

I wrote up the wider validation loop here:

https://meanmail.dev/posts/validate-nginx-configuration?utm_source=reddit&utm_medium=community&utm_campaign=nginx_validation_2026q3&utm_content=deployment_parity_discussion

Do you validate the built image after rendering, or is nginx -t still running against repository files earlier in CI?

u/meanmail_dev — 5 days ago
▲ 126 r/nginx+7 crossposts

New LAB - Damn Vulnerable NGINX Proxy

Hello all,

If you do bug bounty hunting or pentests you surely came across many hosts served from an NGINX server, in this lab (published to OWASP) I combined over 20 misconfigurations found in real world bug disclosures and both classic and novel security research, with an extensive blog where I explained everything you need to level up your NGINX hunting game.

Feel free to check it out, give it a star on Github if you like it, and suggest any ideas you want me to add/fix...

https://vwad.owasp.org/app/damn-vulnerable-nginx-proxy-dvnp/

Happy hunting!

u/OilOverall4190 — 7 days ago