Answer the question
In order to leave comments, you need to log in
How to cache on nginx with https?
Hello, there is nginx + php-fpm, the main server directive hangs at 443:
server {
listen 443 ssl;
# ssl settings here
...
}
server {
listen 80;
server_name book-audio.com *.book-audio.com;
return 301 https://$host$request_uri;
}
server {
listen 80;
location / {
proxy_pass https://127.0.0.1:81/;
proxy_cache all;
proxy_cache_valid any 1h;
proxy_cache_valid 404 502 503 1m;
fastcgi_cache fcgi;
fastcgi_cache_valid 200 60m;
}
}
Answer the question
In order to leave comments, you need to log in
You overdid something.
Redirect http -> https is fine.
All other settings in the section with listen 443 ssl.
In the same place all your location are described.
127.0.0.1:81 is the address of your php-fpm (usually 127.0.0.1:9000)
You continue to access the site https://site.ru without specifying the port.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question