forked from schmunk42/docker-nginx-redirect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.conf
28 lines (22 loc) · 866 Bytes
/
default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
map $http_x_forwarded_proto $redirect_scheme {
default $scheme;
https https;
}
server {
listen 80;
server_name ${SERVER_NAME};
# cherry picked from https://github.com/schmunk42/docker-nginx-redirect/pull/8
if ($request_method = POST) {
return ${SERVER_REDIRECT_POST_CODE} ${SERVER_REDIRECT_SCHEME}://${SERVER_REDIRECT}${SERVER_REDIRECT_PATH};
}
if ($request_method ~ PUT|PATCH|DELETE) {
return ${SERVER_REDIRECT_PUT_PATCH_DELETE_CODE} ${SERVER_REDIRECT_SCHEME}://${SERVER_REDIRECT}${SERVER_REDIRECT_PATH};
}
return ${SERVER_REDIRECT_CODE} ${SERVER_REDIRECT_SCHEME}://${SERVER_REDIRECT}${SERVER_REDIRECT_PATH};
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}