Git Product home page Git Product logo

subdomain-manager-with-nginx's Introduction

subdomain-manager-with-nginx

Setup and manage your subdomains with Docker and Nginx

Build and start subdomain manager:

Starting in daemon mode with docker-compose

  docker-compose up -d --build

Start subdomain manager

Starting in daemon mode with docker-compose

  docker-compose up -d

Steps to add your app to subdomain manager

  1. Open up default.conf in your favorite editor
  2. Copy and paste server block
  3. Rename and update upstream method
  • Before:
  upstream app-two {
    server 10.0.0.205:2222;
  }
  • After:
  upstream [your upstream name] {
    server [machine internal IP]:[your app port];
  }

Upstream name can be the same ad your app name

  1. Update server method:
  • Before:
server {
  listen [::]:80; #IPv6 compatibility
  listen 80;
  server_name app-two.demoapp.com;
  access_log /var/log/app-two.demoapp.access.log;

  location    / {
    proxy_pass  http://app-two;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
}
  • After:
server {
  listen [::]:80; #IPv6 compatibility
  listen 80;
  server_name [your subdomain].[your TLD domain].com;
  access_log /var/log/[your subdomain].[your TLD domain].access.log;

  location    [your base route] {
    proxy_pass  http://[your upstream name];
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
}

subdomain-manager-with-nginx's People

Contributors

amaxwell01 avatar

Watchers

James Cloos avatar  avatar

Forkers

vchumakovv-hub

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.