Skip to content

alexeym/301-to-www

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

#301 to www This is the Git repo of a wee 301-to-www Docker image meant to work in combination with Jason Wilder's nginx-proxy Docker container to help setting up 301 redirects from your non-www to www-based domain URLs.

This is generally done to normalize URLs for the SEO purposes.

##Usage

Run nginx-proxy

$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy

Then start proxied containers with VIRTUAL_HOST environment variable having www-based URL

$ docker run -e VIRTUAL_HOST=www.example.org  ...
...
$ docker run -e VIRTUAL_HOST=www.acme.com  ...

Run 301-to-www container specifying non-www-based host names that requre a 301 redirect

$ docker run -d -e VIRTUAL_HOST=example.org,acme.com alexeym/301-to-www

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published