我一直在设置NginX:443> Varnish:80> Nginx:8080服务器,以充当我在类似AWS Lambda的服务上构建和部署的API服务的缓存。避免触发Cloudfront警告。
我的理解是,关于代理设置,我在最后一台Nginx服务器的设置中搞砸了,但是我似乎不明白。
感谢您的帮助。
配置:
server {
listen *:8080;
listen [::]:8080;
resolver 8.8.8.8 ipv6=off;
server_name cache.mywebsite.com;
location / {
proxy_pass https://api123.provider.com;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_ssl_server_name on;
proxy_ssl_verify on;
proxy_ssl_trusted_certificate /etc/letsencrypt/live/cache.mywebsite.com/fullchain.pem;
proxy_ssl_verify_depth 2;
proxy_ssl_session_reuse on;
}
access_log /var/log/nginx/http-redir-access.log;
error_log /var/log/nginx/http-redir-error.log;
}