I've set up redirection on NGINX with the help of this answer and now I want a setup it with masking redirection from user, i.e. keeping original example.com
.
Things I've tried:
server{
server_name .example.com;
rewrite ^/$ www.lokki.newdomain.com/resources/index.html permanent;
}
server{
server_name .example.com;
location / {
proxy_pass www.lokki.newdomain.com/resources/index.html;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
but none of them worked.
Any suggestions what I am doing wrong?
Environment: AWS EC2 AMI Linux, nginx 1.16.1