0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Nginxでリバプロを構築し、URLpathで振り分ける

Posted at

目的

前回やった様にtraefikでも出来るのだが、周りがNginxを使っているのでnginxで対応しなければならない場合が出てきた。

Docker-compose

一部抜粋

docker-compose.yml
version: '3'

services:
  reverse-proxy:
    image: nginx
    volumes:
      - ./reverse-proxy/nginx.conf:/etc/nginx/nginx.conf
    ports:
      - 80:80


  reveal-docker:
    build: .
    container_name: "reveal-docker"
    volumes:
      - ./md:/etc/reveal/md/
    tty: true

  ul7:
    build: .
    container_name: "ul7"
    volumes:
      - ./ul7:/etc/reveal/md/
    tty: true

nginx.conf

nginx.conf
events {
    worker_connections  16;
}
http {
    server {
        listen 80;
        server_name localhost;

        location /reveal-docker {
            proxy_pass http://reveal-docker:8000/;
            proxy_redirect off;
        }

        location /ul7 {
            proxy_pass http://ul7:8000/;
            proxy_redirect off;
        }

        location /ship {
            proxy_pass http://ship:8000/;
            proxy_redirect off;
        }

        location /codimd {
            proxy_pass http://codimd:3000/;
            proxy_redirect off;
        }

        location /chinenlabweb {
            proxy_pass http://chinenlabweb:80/;
            proxy_redirect off;
        }


    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?