Skip to content

Instantly share code, notes, and snippets.

@kalebheitzman
Created November 10, 2022 16:05
Show Gist options
  • Save kalebheitzman/12d596fbf6d2dcc0f570063f3f72ba63 to your computer and use it in GitHub Desktop.
Save kalebheitzman/12d596fbf6d2dcc0f570063f3f72ba63 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name tecstock.episcopalchurch.org;
return 301 $scheme://www.episcopalchurch.org/tecstock$request_uri;
}
server {
listen 80;
server_name events.episcopalchurch.org;
return 301 $scheme://www.episcopalchurch.org/events$request_uri;
}
server {
listen 80;
server_name media.episcopalchurch.org;
return 301 $scheme://www.episcopalchurch.org/media$request_uri;
}
server {
listen 80;
server_name lessonplans.episcopalchurch.org;
return 301 $scheme://www.episcopalchurch.org/lessonplans$request_uri;
}
@kalebheitzman
Copy link
Author

The events domain probably needs tested pretty thoroughly. The $request_uri parameter should preserve any old links out there and map them correctly. This is obviously untested so ymmv. The port 80 reference wont resolve any https:// domains out there so you will probably have to create server blocks that listen on 443 along with the SSL mappings. You might be able to take out the listen directive entirely without having to do all of that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment