反向代理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
server {
listen 80;
listen 443 ssl;
server_name localhost;

ssl_certificate /etc/nginx/ssl/fullchain.cer;
ssl_certificate_key /etc/nginx/ssl/unsplash.jingxuetao.com.key;

location /api {
rewrite ^.+api/?(.*)$ /$1 break;
proxy_pass https://api.unsplash.com;
}

location /images {
rewrite ^.+images/?(.*)$ /$1 break;
proxy_pass https://images.unsplash.com;
}

}

参考链接

https://www.cnblogs.com/gabrielchen/p/5066120.html
https://www.jianshu.com/p/b34a57129d6c?from=timeline

–EOF–