Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL with GoLang using reverse proxy Nginx

I am currently writing a GoLang website and would like to add SSL soon. My question is what are the advantages/disadvantages of using the built-in Golang SSL packages or should/can I just do SSL with the nginx when I use it for the reverse proxy?

like image 587
biw Avatar asked Jul 11 '26 05:07

biw


1 Answers

It is ultimately up to you, but nginx's SSL configuration is extremely configurable, battle-tested and performant.

  • nginx can provide an SSL session cache to boost performance - ssl_session_cache
  • Good cipher compatibility
  • I believe that nginx's SSL implementation is faster (more req/s and less CPU) than Go's, but have not tested this myself. This would not be surprising given maturity of the nginx project.
  • Other benefits like response caching for both proxied and static content.

The downside, of course, is that it's another moving part that requires configuration. If you are already planning to use nginx as a reverse proxy however I would use it for SSL as well.

like image 111
elithrar Avatar answered Jul 14 '26 07:07

elithrar