server {
    include fastcgi.conf;

    listen 8080;
    server_name _;

    root /app;
    index index.php;

    location @rewrite {
        rewrite ^/(.*)$ /index.php?title=$1&$args;
    }

    location / {
        try_files $uri $uri/ @rewrite;
    }

    location ~ \.php$ {
        fastcgi_pass app:9000;
    }
}
