To log some useful Nginx Server Configurations.
Rewrite
Between Websites
server {
listen 80;
server_name old.com www.old.com;
return 301 $scheme://www.new.com$request_uri;
}
301= permanent;302= temporary$schemeis used to define the protocol (HTTP or HTTPS)$request_urienable redirct for the full url path.e.g.: www.old.com/path/ -> www.new.com/path/