Live data from Hacker News

Show HN: Nginx Common Useful Configuration

github.com

1–10 of 13 posts

Re: Show HN: Nginx Common Useful Configuration

#2
After switching to Traefik, I haven't looked back. I prefer the fully open source options of HAProxy or Traefik to the feature-paywalled "free tier" nginx of today. Capability wise, between the two they have everything ngx has and more*. Also, have you ever tried compiling ngx yourself (they don't include Lua modules support in their k8s Docker images)? It's not easy, interesting, or fun. More of a nightmare.

Finally, I sure don't miss feeling the urge to bookmark config helper articles like this one- nginx is challenging to configure well! Endless hidden options, and for whatever reason I found their documentation less helpful than HAProxy's.

If you are forced to continue using it, you have my sympathy.

* I've created some rather exotic LB setups as times to meet requirements.

Re: Show HN: Nginx Common Useful Configuration

#3
It suddenly feels like Nginx is a legacy system, in the same way Apache became a legacy system when Nginx was launched. If I need a web server my first instinct is to reach for Caddy, or if I just need a reverse-proxy then it's either Caddy or Traefik.

Re: Show HN: Nginx Common Useful Configuration

#5
post #4

Hi guys, I agree with you that today there are a lot of better web servers like traefik, caddy and so one, but nginx is still popular and so one people use it wrong... So I decided to open source my own variant of configs for it)

I don't think you should feel a need to defend this. It's one of the more popular web servers on the Internet, and this looks like a great resource for it.

Re: Show HN: Nginx Common Useful Configuration

#6
glad to see this posted. nginx has driven me crazy the past 4 days. After reading and reading and reading, and experimenting.. I have a feeling that when I ran lets encrypt certbot, it added some things in files that were needed, but became a problem when I actually made the config files that were needed to point to the new folders.. I'm still not sure actually.

I ended up just adding another domain name and configuring it from scratch to point to a matrix client folder, and then running the certbot expand.. and now it's working on a different domain.

Guides like this one posted are much more help trying understand the whole chain of things as opposed to a bunch of random pseduo answers via stackover and the like.

Re: Show HN: Nginx Common Useful Configuration

#7
post #2

After switching to Traefik, I haven't looked back. I prefer the fully open source options of HAProxy or Traefik to the feature-paywalled "free tier" nginx of today. Capability wise, between the two they have everything ngx has and more*. Also, have you ever tried compiling ngx yourself (they don't include Lua modules support in their k8s Docker images)? It's not easy, interesting, or fun. More of a nightmare. Finally…

> Also, have you ever tried compiling ngx yourself (they don't include Lua modules support

There's always OpenResty[1] which is a kind of "batteries included" version of nginx - I use it in preference to nginx these days because I do a lot of experiments with, e.g., the Lua, Redis, Postgres support OR has.

[1] https://openresty.org/en/

Re: Show HN: Nginx Common Useful Configuration

#8

glad to see this posted. nginx has driven me crazy the past 4 days. After reading and reading and reading, and experimenting.. I have a feeling that when I ran lets encrypt certbot, it added some things in files that were needed, but became a problem when I actually made the config files that were needed to point to the new folders.. I'm still not sure actually. I ended up just adding another domain name and configur…

We are what, 6 or 7 years after Let's Encrypt changed how we deal with certificates? The fact that nginx still requires the perfect incantation of certbot, cronjobs and whatnot is mind-boggling.

I love nginx but it's hard to recommend it when other solutions exist that require zero fiddling and zero maintenance to get HTTPS working.

Re: Show HN: Nginx Common Useful Configuration

#9

glad to see this posted. nginx has driven me crazy the past 4 days. After reading and reading and reading, and experimenting.. I have a feeling that when I ran lets encrypt certbot, it added some things in files that were needed, but became a problem when I actually made the config files that were needed to point to the new folders.. I'm still not sure actually. I ended up just adding another domain name and configur…

We are what, 6 or 7 years after Let's Encrypt changed how we deal with certificates? The fact that nginx still requires the perfect incantation of certbot, cronjobs and whatnot is mind-boggling. I love nginx but it's hard to recommend it when other solutions exist that require zero fiddling and zero maintenance to get HTTPS working.

What would you recommend?

Re: Show HN: Nginx Common Useful Configuration

#10
post #4

Hi guys, I agree with you that today there are a lot of better web servers like traefik, caddy and so one, but nginx is still popular and so one people use it wrong... So I decided to open source my own variant of configs for it)

I would appreciate it, if you could annotate the config choices you made with the reason behind them. Example: sendfile on; # default is off tcp_nopush on; # default is off tcp_nodelay on; Why did you set those to on? What improvements do I get compared to the defaults?
Post reply on HN