Fixed nginx config (maybe?)
Added cert generation check when building the image.