user nginx;
error_log stderr warn;

events {}
http {
    include mime.types;
    sendfile on;

    server {
        listen 8080;
        listen [::]:8080;

        autoindex off;

        server_name _;
        server_tokens off;

        access_log /dev/stdout;
        error_log /dev/stderr notice;

        client_body_temp_path /tmp/client_temp;
        proxy_temp_path /tmp/proxy_temp_path;
        fastcgi_temp_path /tmp/fastcgi_temp;
        uwsgi_temp_path /tmp/uwsgi_temp;
        scgi_temp_path /tmp/scgi_temp;

        root /app/;
        index index.html;

        location ^~ /backend {
            internal;
        }

        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param SCRIPT_NAME $fastcgi_script_name;
            include fastcgi_params;
        }

        location ~ ^/(fpm-status|fpm-ping)$ {
            allow 127.0.0.1;
            deny all;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_pass 127.0.0.1:9000;
            access_log off;
        }
    }
}
