Redirect / https://example.com/
(help.ubuntu.ru/wiki/apache_%D0%B8_https) server {
listen *:80;
server_name example.com;
proxy_set_header Host example.com;
location / {
rewrite ^(.*)$ https://example.com$1 permanent;
}
}
server {
listen *:443;
server_name example.com;
proxy_set_header Host example.com;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
if($_SERVER['SERVER_PORT'] != 443) {
header('Location: https://' . $_SERVER['SERVER_NAME']);
}