user  nginx;
worker_processes  auto;
error_log  /var/log/nginx/error.log;
pid        /run/nginx.pid;

include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    sendfile      on;
    client_max_body_size  5M;
    client_body_buffer_size 5M;

    gzip on;
    gzip_comp_level 2;
    gzip_types text/plain text/css text/javascript application/javascript application/xml image/jpeg image/gif image/png;
    gzip_vary on;

    keepalive_timeout  300;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  arcade-engine:9099;

        root  /app;
        client_max_body_size  10m;

        location / {
            proxy_pass http://arcade-engine:9099;

            proxy_set_header Host               $http_host;
            proxy_set_header X-Real-IP          $remote_addr;
            proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto  $scheme;

            proxy_connect_timeout 300s;
            proxy_send_timeout    300s;
            proxy_read_timeout    300s;
        }
    }
}
