<%
=begin

Cookbook Name:: nginx
Attributes:: default

Author:: Damian Curry (<damian.curry@nginx.com>)

Copyright (c) 2017-present, NGINX, Inc.

This source code is licensed under the Apache License (v2.0) found in the LICENSE file in
the root directory of this source tree.

=end
%>

server {
    listen <%= node['nginx']['application_port'] -%>;

    root /usr/share/nginx/html;
    try_files /index.html =404;

    expires -1;

    sub_filter_once off;
    sub_filter 'app_name' 'ec2 WebApp';
    sub_filter 'server_hostname' '$hostname';
    sub_filter 'server_address' '$server_addr:$server_port';
    sub_filter 'server_url' '$request_uri';
    sub_filter 'remote_addr' '$remote_addr:$remote_port';
    sub_filter 'server_date' '$time_local';
    sub_filter 'client_browser' '$http_user_agent';
    #sub_filter 'request_id' '$request_id';
}
