poc nginx node auth
This commit is contained in:
5
nginx/Dockerfile
Normal file
5
nginx/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM nginx:1.17.5-alpine
|
||||
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/config.conf
|
||||
31
nginx/nginx.conf
Normal file
31
nginx/nginx.conf
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location /api {
|
||||
auth_request /auth;
|
||||
auth_request_set $auth_header $upstream_http_x_auth_status;
|
||||
proxy_set_header X-Auth-Status $auth_header;
|
||||
add_header X-Auth-Status $auth_header always;
|
||||
|
||||
proxy_pass http://nodepod:3000;
|
||||
}
|
||||
|
||||
location /auth {
|
||||
internal;
|
||||
proxy_pass http://nodepod:3000/auth;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Contet-Lenght "";
|
||||
proxy_set_header X-Original_URI $request_uri;
|
||||
}
|
||||
|
||||
|
||||
# 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user