News for hackers. Stuff that matters.
Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by Zamicol on Saturday November 23, 2019 @01:39AM (#21612804)
Nginx seems like one more layer of trouble. Why not just use Go?
Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by dthul on Saturday November 23, 2019 @04:25AM (#21613261)
I almost always use a reverse proxy for some or all of the following:

- Serving static files

- Not needing to care about binding your application to a privileged port (below 1024)

- SSL certificate handling

- Hosting several applications on the same IP

For a minimal development setup you might not need it though, depends on what you want to do I guess.

Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by aphextron on Saturday November 23, 2019 @10:30AM (#21614581)
> "I almost always use a reverse proxy for some or all of the following:

- Serving static files

- Not needing to care about binding your application to a privileged port (below 1024)

- SSL certificate handling

- Hosting several applications on the same IP"

All of this should be handled at a higher level with load balancers doing your SSL termination, and CDN for static files. There's no reason your application server should care about any of that stuff.

Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by dthul on Saturday November 23, 2019 @11:50AM (#21614989)
I mostly work on small scale stuff. There is nothing to load balance if you only have one machine :D

And for development you probably don't want to use a CDN.

Edit: it just occurred to me that a load balancer is nothing but a reverse proxy anyway. Running on a different machine usually, but not really different from nginx on the local machine from the point of view of the application software.

Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by rbjorklin on Saturday November 23, 2019 @11:44AM (#21614968)
Which is why s/he is using Nginx to simulate that in the dev environment if I’m not misunderstanding?
Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by tlarkworthy on Saturday November 23, 2019 @07:30AM (#21613795)
Yes nginx is great to bundle in early
Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by charlesworth91 on Saturday November 23, 2019 @06:02AM (#21613533)
I came up on this issue, I think the main problem is as React-Router is being used its a SPA; all front end routes need to resolve to the same index.html. Totally do-able with Go but it was a bit of a pain to get it working, I ended up wrapping the "route not found" handler with some logic to serve index for given frontend routes. nginx gets you this very quickly so I ended up using this instead.
Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by todotask on Saturday November 23, 2019 @03:07AM (#21613025)
If it was my case, I still undecided which reverse proxy can replace Nginx, however, there are no known performance benchmarks for Caddy 2 I could refer to.

Nginx was designed to handle backend services easily and programmers from different background may not be well verse in Golang at the beginning.

Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by sneak on Saturday November 23, 2019 @03:54AM (#21613169)
It is generally repeated that the Go stdlib webserver is internet-facing-ok and production-ready (with appropriate timeouts being set on the http.Server), making a reverse proxy unnecessary.

There are also dead-simple TLS libraries, some that will even get LE certs automatically.

Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by todotask on Saturday November 23, 2019 @07:05AM (#21613709)
Agreed, I have recently built a web server entirely (with timeouts) in Go too and acme.sh for LE certs but I still haven't find a way to support Wordpress from Go to PHP-FPM, I'm not well verse to fix the only this part, if you have any suggestion is greatly appreciate.
Re:Show HN: PNGR – Docker-compose for a Postgres-Nginx-Golan... by zwarag on Saturday November 23, 2019 @02:28AM (#21612925)
Ssl certificate

Reverse Proxy for possible load balancing?