Answer the question
In order to leave comments, you need to log in
Site on http/2. How to open certain pages via http/1.1?
I've searched all over Google and found nothing.
In general, http/2 is configured.
Task :
Open certain pages (starting with https://site.ru/somepage/
) via http/1.1 protocol
server {
listen ip_address:443 ssl http2;
server_name site.ru www.site.ru;
ssl on;
add_header Strict-Transport-Security "max-age=31536000;" always;
ssl_stapling on;
ssl_stapling_verify on;
ssl_certificate /home/admin/conf/web/ssl.sit.ru.pem;
ssl_certificate_key /home/admin/conf/web/ssl.site.ru.key;
error_log /var/log/apache2/domains/site.ru.error.log error;
}
header('Content-Description: File Transfer');
header('Content-Transfer-Encoding: binary');
header('Content-Type: application/epub+zip');
header('Content-Length: '.filesize($file));
header('Content-Disposition: attachment; filename="'.$filename.'"');
// force to disable caching
header("Cache-Control: no-cache, no-store, max-age=0, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // For old clients http/1.0
header("Expires: -1"); // ensure that clients immediately treat this response as stale and avoid caching
header("X-XSS-Protection: 1; mode=block");
Answer the question
In order to leave comments, you need to log in
In nginx, at the location level, it is impossible to select a protocol, only at the level of the entire virtual host (in fact, even the port, if not fixed yet). So, either fall back completely to http 1.1, or put up with the problem.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question