Home  >  Q&A  >  body text

Is it necessary to use nginx when using golang?

If a service only deploys a web service developed with golang, is it necessary to use nginx

给我你的怀抱给我你的怀抱2712 days ago2120

reply all(5)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 17:09:07

    Of course.
    Not to mention anything else,
    1. Static resources css, js, img require nginx
    2. nginx has many mature plug-ins, such as filtering IP, such as redirection, for example. For example, it doesn’t come out. Anyway, there are many
    Of course, if you don’t want to use it, you can just open a go web service.


    If I say I need to use it, I will be stepped on.
    Then should I answer, it’s better to use it if you want to use it, and don’t use it if you don’t want to use it?
    Everyone expresses his own opinion.

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 17:09:07

    It mainly depends on whether the golang web service you develop needs to use Nginx function points.

    For example, use Nginx to bind domain names, forward requests, use Nginx upstream to do load balancing at the application layer, do url hash to forward requests, etc.

    If your web service is an internal service, you don’t need Nginx in many cases.

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-16 17:09:07

    Look at the scenario. For example, I developed a web service A using golang, which does not support https. At this time, I can configure https through nginx and use reverse proxy to access A without modifying the code.

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 17:09:07

    When you find that you don’t need to use it, don’t use it.

    When you really need some nginx functions, it is very simple to switch.

    If caddy has the required functions, you can use caddy.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 17:09:07

    No need to rush. . . It’s no trouble to add more when needed

    reply
    0
  • Cancelreply