An nginx-powered utility server for the core AAS WorldWide Telescope website.
Перейти к файлу
Peter Williams 9591db3921
Merge pull request #20 from pkgw/windows-6.1.2.0
temporary_redirects.map: update for Windows 6.1.2.0
2022-07-12 19:36:21 +00:00
static static/Home.aspx: add this (and home.aspx too) 2020-12-11 10:06: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: update the example to use the installer link 2022-01-04 15:43:18 -05:00
azure-pipelines.yml Initial import 2020-03-27 10:54:11 -04:00
nginx.conf.template Set up a redirection to the latest available installer 2021-12-22 17:36:18 -05:00
permanent_redirects.map permanent_redirects.map: /beta/WWTSetup.3.0.60.msi 2020-12-11 11:19:47 -05:00
temporary_redirects.map temporary_redirects.map: update for Windows 6.1.2.0 2022-07-12 15:34:50 -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 /support/wwtsetup-latest.msi HTTP/1.1
Host: worldwidetelescope.org

HTTP/1.1 302 Moved Temporarily
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.