I am writing some webservices returning JSON data, which have lots of users.
What are the benefits of using Nginx in front my server compared to just using the go http server?
Introduction. Apache and Nginx are two popular open-source web servers often used with PHP. It can be useful to run both of them on the same virtual machine when hosting multiple websites which have varied requirements.
NGINX is a web server that also acts as an email proxy, reverse proxy, and load balancer. The software's structure is asynchronous and event-driven; which enables the processing of many requests at the same time. NGINX is highly scalable as well, meaning that its service grows along with its clients' traffic.
It depends.
Out of the box, putting nginx in front as a reverse proxy is going to give you:
The Go HTTP server is very good, but you will need to reinvent the wheel to do some of these things (which is fine: it's not meant to be everything to everyone).
I've always found it easier to put nginx in front—which is what it is good at—and let it do the "web server" stuff. My Go application does the application stuff, and only the bare minimum of headers/etc. that it needs to. Don't look at putting nginx in front as a "bad" thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With