Sign inSign up

sellerlabs/nginx-rewriter

By sellerlabs

•Updated over 10 years ago

Takes a YAML file of domains and rewrite rules and serves them up with nginx.

Image
1

411

sellerlabs/nginx-rewriter repository overview

The URL of the YAML file is supplied in an environment variable. The /start.py script pulls the YAML file down, creates some server stanzas in conf.d, and starts nginx in the foreground. SSL is not yet supported. This image is great for taking a bunch of aliases for your domain and redirecting them to their preferred names.

⁠Environment Variables

CONFIG_URL - URL of the YAML config file

⁠Config File Format

---
domain1:
  rewriterules:
    - sourcepattern destinationpattern type

⁠Example Configuration File

---
example.cn:
  rewriterules:
    - ^/images/(.*)$ http://images.example.com/$1 redirect;
    - ^/js/(.*)$ http://scripts.example.com/$1 permanent;
another.com:
  rewriterules:
    - ^(.*)$ https://thirdname.com/$1 permanent;

Tag summary

Content type

Image

Digest

Size

163.4 MB

Last updated

over 10 years ago

docker pull sellerlabs/nginx-rewriter