if ($host = site1.com) {
return 301 https://$host$request_uri;
}
if ($request_uri = /) {
return 301 https://$host$request_uri;
}
if ($request_uri = /blabla/bla.php) {
return 301 http://$host$request_uri;
}
server {
if ($request_uri = /) {
return 301 https://$host$request_uri;
}
listen 80;
server_name site1.com;
access_log /var/log/nginx/http-access.log;
error_log /var/log/nginx/http-error.log;
location / {
proxy_pass http://10.10.10.20;
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;
}
}
server {
if ($request_uri = /blabla/bla.php) {
return 301 http://$host$request_uri;
}
listen 443;
server_name site1.com;
access_log /var/log/nginx/https-access.log;
error_log /var/log/nginx/https-error.log;
location / {
proxy_pass http://10.10.10.20;
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;
}
ssl_certificate /etc/letsencrypt/live/site1.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/site1.com/privkey.pem; # managed by Certbot
}
всё тормозит, при том что сервер не загружен и на половину