- 挂载
将docker容器中的Nginx的配置文件挂载出来
container cp Nginx:/etc/nginx/conf.d/default.conf
/etc/nginx/conf.d
server {
listen 80;
server_name 192.168.1.101;
index index.html;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /api/ {
auth_request /auth;
proxy_pass http://192.168.1.101:8080/success;
}
location = /auth {
internal;
set $query '';
if ($request_uri ~* "[^\?]+\?(.*)$") {
set $query $1;
}
proxy_pass http://192.168.1.101:8080/verify?$query;
proxy_pass_request_body off;
proxy_set_header Content-Type "";
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}