Knowledgebase
emscom > emscom Help Desk > Knowledgebase

Search help:


Synology error pages

Solution

ref: https://ds620slim.synology.me/posts/Synology_WebStation_custom_error_pages-(en).html

DSM 6.2.2-24922 Update 4

The default web server used by WebStation is nginx.

Each time WebStation is restarted, the configuration files are regenerated in order to avoid any error that could block the operation of WebStation. Configuration files are created from mustache template.

The mustache template for configuring error pages can be found in the directory :

/var/packages/WebStation/target/misc/

This is the file :

/var/packages/WebStation/target/misc/nginx_web_error_page.mustache

This model generates the configuration file used by nginx :

/etc/nginx/app.d/server.webstation-vhost.conf

The content of the mustache model is :

error_page 400 401 402 403 404 405 406 407 408 500 501 502 503 504 505 @error_page;

location @error_page {
    root /var/packages/WebStation/target/error_page;
    rewrite ^ /$status.html break;
}

You can modify it as follows :

error_page 400 401 402 403 405 406 407 408 500 501 502 503 504 505 @error_page;
error_page 404 /404.html;

location @error_page {
    root /var/packages/WebStation/target/error_page;
    rewrite ^ /$status.html break;
}

Then the file in the root of the web server directory named 404.html will be displayed as a 404 error file. The root of the site is not /volume1/web/, that is to say the shared folder, but /volume1/web/mywebsite if the directory /mywebsite/ contains the files for your site.

 
Was this article helpful? yes / no
Related articles Install NGinX and PHP on Windows
modoboa letsencrypt renewal failure
Article details
Article ID: 160
Category: NAS
Date added: 26-10-2021 09:15:22
Views: 152
Rating (Votes): Article not rated yet (0)

 
« Go back

 
Powered by Help Desk Software HESK, in partnership with SysAid Technologies