首先我们在swagger拿到一个http服务接口文档,现在要通过Nginx来代理。
例如:
配置示例:
upstream mth-finance-capital-service { // 服务名
server 11.111.111.111:1111; // 这个是swagger上的地址路径包括端口
keepalive 10;
}
location /mth-finance-capital-service { // 服务名
root html;
index index.html index.htm;
proxy_pass http://mth-finance-capital-service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
client_max_body_size 100m;
}