N
N
Niko True2014-06-09 15:13:58
Nginx
Niko True, 2014-06-09 15:13:58

How to set up static distribution for error page in nginx?

Set up:

error_page 503 /503.html;
location = /503.html {
      root /var/www/domain/error/;
}

So sweat pictures, css, js can't find it. I don't understand how to set it up. Help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Alekseev, 2014-06-09
@buloshnik

For example,

location ~* ^.+\.(css|js)$
{
    root   /var/www/domain/error/assets;
}

B
bhavenger, 2014-06-10
@bhavenger

Select locations separately and link to them in your 503 page.
location ^~ /images/ {
root /var/www/domain/error/assets;
expires 1d;
}
location ^~ /css/ {
root /var/www/domain/error/assets;
expires 1d;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question