4 ms·
Ask HN: Has anyone found a good hands on way to learn nginx.conf?
I've been searching for a playground to learn nginx configuration in, something similar to https://regexr.com/ but for nginx conf. Nothing seems to be out there.
Has anyone found a good hands on way to learn nginx.conf?
- NegativeLatency 7y agoI'll usually put the following at the top of my conf when I'm trying to get something to work, and want to test it out interactively (makes it run without forking, and log to stdout instead of a file you'd then have to tail): daemon off; master_process off; error_log /dev/stdout;
- seph-reed 7y agobrilliant. the logging bit has been slow, and this seems very helpful. > makes it run without forking what's forking? I didn't find much in a query (https://duckduckgo.com/?q=nginx+forking https://duckduckgo.com/?q=nginx+forking)
- NegativeLatency 7y agonormally when you start nginx it will start another process, detach it from your shell and then exit. This leaves the other process running. https://en.wikipedia.org/wiki/Daemon_(computing) https://en.wikipedia.org/wiki/Daemon_(computing) https://stackoverflow.com/questions/17954432/creating-a-daemon-in-linux/17955149#17955149 https://stackoverflow.com/questions/17954432/creating-a-daem... When you don't let it fork you can easily hit control c to kill the server, make some config changes and then restart.
- seph-reed 7y agoAh. Thank you. I did not realize this was called forking.
- vkaku 7y agoMine is usually modular. You just want to keep all services, hosts and common things included. I start with the bare minimum and start adding as need be.