proxy_cache_path cache levels=1:2 keys_zone=my_cache:10m;
server {
listen 80;
# listen [::]:80 default_server;
server_name test.com;
# return 302 https://$server_name$request_uri;
location / {
proxy_cache my_cache;
proxy_pass http://127.0.0.1:8888;
proxy_set_header Host $host;
}
}
server {
listen 443;
server_name test.com;
ssl on;
ssl_certificate_key /Applications/XAMPP/xamppfiles/htdocs/HTTPstudy1/https/localhost-privkey.pem;
ssl_certificate /Applications/XAMPP/xamppfiles/htdocs/HTTPstudy1/https/localhost-cert.pem;
location / {
proxy_cache my_cache;
proxy_pass http://127.0.0.1:8888;
proxy_set_header Host $host;
}
}