Nginx support

Is there nginx support documentation somwhere?

Nevermind I got it

location /assets/ {
    if (!-e $request_filename) {
        rewrite ^/assets/(.*)  /wp-content/themes/roots/assets/$1 last;
                    }
    }

If anyone else needs it.

You’ll have plugin issues if you only have that one rule. Also try_files is better for performance.
Use these instead (from the readme):

location ~ ^/assets/(img|js|css|fonts)/(.*)$ {
  try_files $uri $uri/ /wp-content/themes/roots/assets/$1/$2;
}
location ~ ^/plugins/(.*)$ {
  try_files $uri $uri/ /wp-content/plugins/$1;
}
1 Like

Hm, if I would switch between themes I would also need to update this configuration every time?

Only if your theme directory name is changed - it’s part of your Nginx configuration, not anything in WordPress.

Also, rewrites are no longer included within Roots. They’ve been moved to a plugin - we now recommend that you just use Composer to manage WP to have the ‘cleaner’ URLs.