I'm having trouble configuring wordpress on a subfolder of my Laravel app on Laravel Forge (server is powered by nginx).

The Wordpress-app is located under `/home/forge/my-domain.com/public/blog` (`my-domain.com` contains my laravel app).

I've tried several answers from other questions here on SO, but I keep getting errors (mostly "too many redirects" or "502 bad gateway").

This is my current solution (taken from [here](https://stackoverflow.com/questions/34568960/nginx-running-wordpress-in-subfolder-of-a-symfony2-app) - resulting in a 502 bad gateway, also for the admin-area of my wordpress-app):

```
# BLOG START
location @rewriteblog {
    rewrite ^(.*)$ /blog/index.php?q=$uri&$args;
}

location @rewriteblogadmin {
    rewrite ^(.*)$ /blog/wp-admin/index.php?q=$uri&$args;
}

location = /blog/favicon.ico {
    log_not_found off;
    access_log off;
}

location = /blog/robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}

location /blog {
    try_files $uri @rewriteblog;
}

location /blog/wp-admin {
    try_files $uri @rewriteblogadmin;
}

location ~ ^/(blog|blog\/wp-admin)/(.*)\.php(/|$) {
    try_files $uri =404;
    fastcgi_index index.php;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;

    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    fastcgi_param DOCUMENT_ROOT $realpath_root;

    fastcgi_intercept_errors on;
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
}
#BLOG-END

```

Another attempt was this (502 Bad Gateway):

```
location /blog {
    root      /home/forge/my-domain.com/public/blog;
    index     index.php;
    try_files $uri $uri/ /blog/index.php?q=$uri;
}

```

Another attempt was this (Admin-Area and startpage accessible, posts result in too many redirects):

```
location /blog {
    root      /home/forge/my-domain.com/public/;
    index     index.php;
    try_files $uri $uri/ /blog/index.php?q=$uri;
}

```

Another attempt was this (Admin-Area and startpage too many redirect, posts accessible):

```
location /blog {
    root      /home/forge/faaren.com/public/blog;
    index     index.php;
    try_files $uri $uri/ /index.php?q=$uri;
}

```

Any ideas how to configure my nginx to get this done?