# HTTP configuration
#
server {
    listen 8080 default_server;
    listen [::]:8080 default_server;

    root /var/www/html/public;

    # Set allowed "index" files
    index index.html index.htm index.php;

    server_name _;

    charset utf-8;

    # Set max upload to 2048M
    client_max_body_size 2048M;

    # Have NGINX try searching for PHP files as well
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # Pass "*.php" files to PHP-FPM
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_param HTTP_X_FORWARDED_FOR $http_fly_client_ip;
        fastcgi_pass unix:/var/run/php/php-fpm.sock;
    }

    # additional config
    include /etc/nginx/server-opts.d/*.conf;
}
