Is cowboy enough for most Phoenix deployment. Is it at par with nginx or apache

I always put nginx in front of my applications too, rock solid and never causes any problems.

It does break HTTP/2 though, squid is better for that.

Care to explain? I know I have had some problems with Nginx and websockets about a year ago. Anything I should know :question:

Last I checked nginx doesn’t support reverse proxy’ing http/2, has that changed?
Websockets have worked for years in nginx.

Last time I checked Docker and sytemd where not good friends :wink:

The preferred way is to use the @kannix suggestion of using the --restart flag, or event better to set it in the Dockerfile.

Cowboy (the erlang ssl module actually) will automatically detect new PEM files and refresh the certificate cache. Just replace PEM files and wait a bit. If you’re in a big hurry you can clear the cache yourself. Either way, no need to restart cowboy.

http://erlang.org/doc/man/ssl.html#clear_pem_cache-0

2 Likes

Last I checked nginx doesn’t support reverse proxy’ing http/2, has that changed?
Websockets have worked for years in nginx.

Nginx has two sets of buffers, one used for synchronous communication (http/2) and the the other for asynchronous communication (http). The mounting point part of reverse proxy entry would still work (location /some/path{}), its when it upgrades to http/2 the buffers in the proxy are bypassed, because they are designed not to send anything to the client until the client is finished with the last response.

1 Like