How to add custom nginx setting?

using docker with nginx

I want add some security feature and server setting

example

server {
    listen       443 ssl http2;
    server_name  _;
    return 404;