An nginx-powered utility server for the core AAS WorldWide Telescope website.
Перейти к файлу
Peter Williams 1c261e4d75 static/favicon.ico: add this 2020-12-10 15:56:53 -05:00
static static/favicon.ico: add this 2020-12-10 15:56:53 -05:00
Dockerfile Redirect /docs URLs to better locations 2020-03-27 15:38:51 -04:00
LICENSE Initial import 2020-03-27 10:54:11 -04:00
README.md README.md: elaborate the instructions a tiny bit more 2020-08-19 16:12:52 -04:00
azure-pipelines.yml Initial import 2020-03-27 10:54:11 -04:00
nginx.conf.template nginx.conf.template: add redirecting vhost for binder.wwt-forum.org 2020-08-19 16:12:40 -04:00
permanent_redirects.map permanent_redirects.map: add redirects for URLs removed from the user-facing website 2020-04-26 00:05:50 -04:00
temporary_redirects.map Implement `/webclient` and `/` redirects 2020-03-27 11:36:12 -04:00

README.md

Build Status

WWT nginx Core Server

This repository contains setup for a backend component of the AAS WorldWide Telescope web services.

In particular, the core WWT website runs an nginx web server to handle miscellaneous redirections and serve certain static files. The responsibilities of this server are a hodgepodge based on the website's historical URL routes, since we route incoming requests to different backends using URL path routing in our Azure Application Gateway frontend.

This server also has vhosts configured to serve up a few special-purpose domains with extremely limited functionality, e.g. redirecting the old forum.worldwidetelescope.org to wwt-forum.org.

Building / Installation

This isn't really software that "install" yourself. The output artifact of this repository is a Docker image that you obtain with the command:

docker build -t aasworldwidetelescope/nginx-core:latest .

You can then run the server locally with a command such as:

docker run --rm -p 8888:80 aasworldwidetelescope/nginx-core:latest

but you'll need to manually telnet in HTTP requests to get anything to work due to the vhost configuration. E.g.,

$ telnet localhost 8888
GET /foobar HTTP/1.1
Host: binder.wwt-forum.org

HTTP/1.1 301 Moved Permanently
Server: nginx/1.16.1
...

The main purpose of this pipeline is to automate the build and publication of this image through the azure-pipelines.yml file. The image ultimately emerges as aasworldwidetelescope/nginx-core. A webhook is configured there to update the running service on Azure.

The live servers are run as virtual hosts as Azure App Services behind an Azure Application Gateway. Because they are run as vhosts, each request must be passed the correct HTTP Host header, pointing to something like wwtnginxcore-prod.azurewebsites.net. However, that means that if this server issues redirects, by default they will point to the App Service domain name, not the actual worldwidetelescope.org domain. App Gateway doesn't seem to provide a facility for us to correctly rewrite any outgoing Location headers from the App Service, so we instead provide a mechanism to make sure that the emitted URLs point to the intended domain. If the environment variable PUBLIC_FACING_DOMAIN_NAME is set, redirection URLs will be rooted accordingly, with the scheme determined from a X-Forwarded-Proto HTTP header if available.

Contributions

Contributions are welcome! See the WorldWide Telescope contributors guide for applicable information. We use a standard workflow with issues and pull requests. All participants in this repository and the WWT communities must abide by the WWT Code of Conduct.

Legalities

The files in this repository are copyright the .NET Foundation, licensed under the MIT License.

Acknowledgments

wwt-nginx-core is part of the AAS WorldWide Telescope system, a .NET Foundation project managed by the non-profit American Astronomical Society (AAS). Work on WWT has been supported by the AAS, the US National Science Foundation (grants 1550701 and 1642446), the Gordon and Betty Moore Foundation, and Microsoft.