0

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:

rewrite

server{
    server_name .example.com;
    rewrite ^/$ www.lokki.newdomain.com/resources/index.html permanent;
}

proxy_pass:

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

Suncatcher
  • 594
  • 2
  • 7
  • 22
  • To keep the same domain name in the browser, you need to use `proxy_pass`. But there are many reasons why your existing attempt may not work. Missing scheme, incorrect value for Host, inability to find resources. And many sites are just very difficult to reverse proxy. – Richard Smith Nov 27 '19 at 07:39
  • so how to debug the reason? what steps to perform? – Suncatcher Nov 28 '19 at 03:26

0 Answers0