server {
listen 111.111.111.111:443 ssl http2;
server_name site1.com;
ssl_certificate /etc/letsencrypt/live/site1.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site1.com/privkey.pem;
location / {
return 301 https://site2.com$request_uri;
}
location /secure/ {
try_files $uri =404;
}
}
server {
listen 111.111.111.111:80;
server_name site1.com;
return 301 http://site2.com$request_uri;
}