Skip to content

Instantly share code, notes, and snippets.

@htuscher
Created October 25, 2018 19:16
Show Gist options
  • Save htuscher/53b5203ed2dfecf101ba9861cbe7fcda to your computer and use it in GitHub Desktop.
Save htuscher/53b5203ed2dfecf101ba9861cbe7fcda to your computer and use it in GitHub Desktop.
WebDevOps nginx custom error pages
error_page 404 = /notfound.html;
error_page 500 = /error.html;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_read_timeout <PHP_TIMEOUT>;
fastcgi_intercept_errors on;
}
FROM webdevops/php-nginx:ubuntu-16.04
COPY 10-php.conf /opt/docker/etc/nginx/vhost.common.d/
@Redempter
Copy link

Thank you! That worked great to fix my custom error 500 page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment