You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to figure out how to get nginx to display the 404.html in a specific sites root.
If entered directly, i.e. domain.tld/404.html it works of course but hitting any non existent url it renders the default nginx error page.
I tried adding an error_page directive under the default server config for nginx and restarted the service with no luck. Specifically error_page 404 /404.html as per http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page. Both in the server block and the location block.
Is there a way to enable this already that I'm missing? I know MIAB is not intended to be a complex web server but having even a default to attempt a /404.html before the default would be pretty awesome.
The text was updated successfully, but these errors were encountered:
when you create a site, you have a subdirectory "domain.tld"
In the same directory, you create domain.tld.conf; in this file, you can add directives as from the above nginx link.
after modifieng the .conf file, you only have to do nginx -t (for testing the config file) and systemctl restart nginx.service for loading a correct config file
I'm trying to figure out how to get nginx to display the
404.html
in a specific sites root.If entered directly, i.e.
domain.tld/404.html
it works of course but hitting any non existent url it renders the default nginx error page.I tried adding an
error_page
directive under the default server config for nginx and restarted the service with no luck. Specificallyerror_page 404 /404.html
as per http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page. Both in the server block and the location block.Is there a way to enable this already that I'm missing? I know MIAB is not intended to be a complex web server but having even a default to attempt a
/404.html
before the default would be pretty awesome.The text was updated successfully, but these errors were encountered: