Skip to content

Commit

Permalink
feat(container/nginx-storage): error.json for error (#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd authored Apr 24, 2023
2 parents b879b38 + 90152b4 commit f87d04a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions cloud/container/nginx-storage/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*
!conf/
!index.json
!_error.json
1 change: 1 addition & 0 deletions cloud/container/nginx-storage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ ENV NGINX_OPEN_FILE_CACHE_INACTIVE=1s \

RUN rm -fv index.html
COPY index.json ./
COPY _error.json /var/www/
COPY conf/ /etc/nginx/templates/
8 changes: 8 additions & 0 deletions cloud/container/nginx-storage/_error.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ok": false,
"statusCode": $status,
"errorCode": "error_$status",
"data": {
"status": "$status_text"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511 /_error.json;

location = /_error.json {
ssi on;
internal;
auth_basic off;
root /var/www;
}

0 comments on commit f87d04a

Please sign in to comment.