Welcome! Log In Create A New Profile

Advanced

Re: Cloak a hostname

Reinis Rozitis
March 12, 2014 10:52AM
> Is it possible assuming I have a domain and uri:
>
> http://foo.bar/candy

> To have the browser location still show http://foo.bar/candy but actually
> fetch the content from:
>
> http://newdomain.com/candy

If your server runs on foo.bar then:

server {
location / {
proxy_pass http://newdomain.com;
}
}


p.s. though It depends if the returned content contains relative or full
urls - then you might/can in combination with the proxy_pass use also the
Sub module ( http://nginx.org/en/docs/http/ngx_http_sub_module.html ) - egg
add something like:

sub_filter //newdomain.com //foo.bar;
sub_filter_once off;

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Cloak a hostname

justink101 March 12, 2014 12:04AM

Re: Cloak a hostname

Reinis Rozitis March 12, 2014 10:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready