Want to show your appreciation and help with hosting costs? Support us on Patreon!
Submitted by awkwardusername on September 24, 2015

Section 1 (Text)

server {
    listen 80;

    server_name sample.com;

    root /var/www/html/blog;

    index index.php;

    location /blog {
        root /var/www/html;
        index index.php;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }


    location /cms {
        root /var/www/html/blog;
        index index.php;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
        root /var/www/html/blog;
        index index.php;
        try_files $uri $uri/ /index.php?q=$uri&$args;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;

        include                 fastcgi_params;
        fastcgi_index           index.php;
        fastcgi_param           SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param           SERVER_NAME $host;
        fastcgi_pass            unix:/var/run/php5-fpm.sock;
        fastcgi_read_timeout    720;
    }
}