• Stars
    star
    107
  • Rank 322,590 (Top 7 %)
  • Language
    Shell
  • Created over 8 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker container for redirecting web-traffic based on nginx

docker-nginx-redirect

A very simple container to redirect HTTP traffic to another server, based on nginx

Resources

Configuration

Environment variables

  • SERVER_REDIRECT - server to redirect to, eg. www.example.com
  • SERVER_NAME - optionally define the server name to listen on eg. ~^www.(?<subdomain>.+).example.com
    • useful for capturing variable to use in server_redirect.
  • SERVER_REDIRECT_PATH - optionally define path to redirect all requests eg. /landingpage
    • if not set nginx var $request_uri is used
  • SERVER_REDIRECT_SCHEME - optionally define scheme to redirect to
    • if not set but X-Forwarded-Proto is send as request header with value 'https' this will be used. In all other cases nginx var $scheme is used
  • SERVER_REDIRECT_CODE - optionally define the http status code to use for redirection
    • if not set or not in list of allowed codes 301 is used as default
    • allowed Codes are: 301, 302, 303, 307, 308
  • SERVER_REDIRECT_POST_CODE - optionally define the http code to use for POST redirection
    • useful if client should not change the request method from POST to GET
    • if not set or not in allowed Codes SERVER_REDIRECT_CODE is used
    • so per default all requests will be redirected with the same status code
  • SERVER_REDIRECT_PUT_PATCH_DELETE_CODE - optionally define the http code to use for PUT, PATCH and DELETE redirection
    • useful if client should not change the request method from PUT, PATCH and DELETE to GET
    • if not set or not in allowed Codes SERVER_REDIRECT_CODE is used
    • so per default all requests will be redirected with the same status code
  • SERVER_ACCESS_LOG - optionally define the location where nginx will write its access log
    • if not set /dev/stdout is used
  • SERVER_ERROR_LOG - optionally define the location where nginx will write its error log
    • if not set /dev/stderr is used

See also docker-compose.yml file.

Usage

With docker-compose

docker-compose up -d

With docker

docker run -e SERVER_REDIRECT=www.example.com -p 8888:80 schmunk42/nginx-redirect
docker run -e SERVER_REDIRECT=www.example.com -e SERVER_REDIRECT_PATH=/landingpage -p 8888:80 schmunk42/nginx-redirect
docker run -e SERVER_REDIRECT=www.example.com -e SERVER_REDIRECT_PATH=/landingpage -e SERVER_REDIRECT_SCHEME=https -p 8888:80 schmunk42/nginx-redirect

Built by dmstr

More Repositories

1

yii2-giiant

Yii 2 Framework Code Generator Gii on Steroids
PHP
271
star
2

gii-template-collection

Gii Template Collection with code templates for models and CRUDs
PHP
51
star
3

docker-yii2-app-basic

Docker Container for Yii 2.0 Basic Application
Shell
40
star
4

docker-gitlab-runner

GitLab CI runner with docker-compose support (based on gitlab-ci-multi-runner)
Dockerfile
32
star
5

database-command

Yii command to create database migrations from existing schema
PHP
19
star
6

yii2-extension-requests

Ideas "marketplace" for Yii 2 extensions
18
star
7

yii2-packaii

Yii 2 Composer Package Toolkit
PHP
16
star
8

p3media

Yii media manager module
PHP
13
star
9

docker-mariadb-example-databases

Dockerfile for MariaDB Server with example databases
Shell
12
star
10

p3admin

Yii backend module
PHP
12
star
11

p3extensions

Extensions shared among Phundament 3 core modules
HTML
11
star
12

p3widgets

Yii widget management module
PHP
9
star
13

doma

Makefile templates for dockerized applications
Makefile
8
star
14

yii2-markdocs-module

Yii 2.0 Markdown Docs Module
PHP
8
star
15

yii-relation

Yii Framework active record relation components
PHP
7
star
16

multi-theme

Yii Framework Theme-Manager class, switch themes by regular expressions on controller routes.
PHP
6
star
17

giic

Toolset for running Gii on the command line
PHP
5
star
18

nano

Phundament application template
PHP
4
star
19

php-inflector

Standalone PHP 5.2 Inflector backport from Yii 2.0
PHP
4
star
20

docker-boilr

Docker image for boilr
3
star
21

repojis

Biased emoji meanings for developers
3
star
22

web-user-behavior

Yii Behavior, which implments features from WebUser from mishamx/yii-user
PHP
3
star
23

docker-toolbox

docker, docker-machine & docker-compose
Dockerfile
3
star
24

p3pages

PHP
3
star
25

yii-ckeditor-configurator

Yii Framework module to handle ckeditor templates and styles
PHP
2
star
26

lessii

2
star
27

eucliid

Euphemistic CLI for Yii 2.0 Framework (optionally built with Docker)
2
star
28

yii2-yaml-converter-command

DEPRECATED
PHP
2
star
29

foxy-roxy-rabbit

WIP - A dockerized application template for Yii 2.1 Framework
PHP
2
star
30

yii-access

Yii Framework extension for access checks on active record level
PHP
2
star
31

p3bootstrap

Bootstrap Theme for Phundament 3
CSS
2
star
32

yii2-sakila-module

Demo project for schmunk42/yii2-giiant
PHP
2
star
33

yii-backend-theme

Yii Framework Theme for Application Backend
CSS
1
star
34

yii2-templay

Template toolkit for Yii Framework 2
PHP
1
star