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–