{% set nginx = salt['grains.filter_by']({
    'default': {
        'keepalive_timeout': 120,
        'install_from_source': True,
        'log_formats': {
            'main': '$remote_addr - $remote_user [$time_local] $http_host "$request" $status $body_bytes_sent $request_time $upstream_response_time "$http_referer" "$http_user_agent" "$http_x_forwarded_for"',
        },
        'log_files': {
            'access.log': 'main'
        },
        'extra_http': [],
        'package': 'nginx',
        'repo': 'deb https://nginx.org/packages/mainline/debian/ jessie nginx',
        'repo_key_url': 'https://nginx.org/keys/nginx_signing.key',
        'dh_keysize': 4096,
        'allow_plaintext': True,
        'add_default_https': True,
        'add_default_http': True,
    },
}, merge=salt['pillar.get']('nginx')) %}

{% set nginx = salt['grains.filter_by']({
    'base': {
        'keepalive_timeout': 120,
        'install_from_source': True,
        'log_formats': {
            'main': '$remote_addr - $remote_user [$time_local] $http_host "$request" $status $body_bytes_sent $request_time $upstream_response_time "$http_referer" "$http_user_agent" "$http_x_forwarded_for"',
        },
        'log_files': {
            'access.log': 'main'
        },
        'extra_http': [],
        'package': 'nginx',
        'repo': 'deb https://nginx.org/packages/mainline/debian/ jessie nginx',
        'repo_key_url': 'https://nginx.org/keys/nginx_signing.key',
        'dh_keysize': 4096,
        'allow_plaintext': True,
        'add_default_https': True,
        'add_default_http': True,
    },
    'stretch': {
        'repo': 'deb https://nginx.org/packages/mainline/debian/ stretch nginx',
    }
}, grain='oscodename', merge=salt['pillar.get']('nginx'), base='base') %}

Add support for debian stretch to nginx state
Add support for debian stretch to nginx state
