Laravel 5.2 wordpress integration on laravel forge using nginx

I have a laravel 5.2 web app built and hosted on laravel forge. No problem so far, but my client has asked me to install a wordpress blog on the app. So far, I have downloaded the wordpress files and have made and installed them in the public/blog folder. I want to see the blog at http://www.example.com/blog. I have read other answers about needing to change my nginx.conf file because of issues with permalinks? I want to enable permalinks and have a clean install of wordpress so what changes do i need to make to my nginx.conf file?

Related posts

1 comment

  1. What you need is to add some rules for your WordPress directory (and all other directories you want to use) before Laravel rules.

    For nginx rules will look like:

    location /blog/index.php(/.*)?$ {        
        fastcgi_split_path_info ^(/blog/index.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 1000;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include fastcgi_params;
    }
    location /blog/ { 
        if (!-e $request_filename) {
                rewrite ^.*$ /blog/index.php last;    
            }
        try_files $uri $uri/ blog/index.php?args; 
    }
    

    Please look here for a solution.

Comments are closed.