Compare commits
1
Commits
master
...
nginx-proxy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77c68f4dd5 |
@@ -0,0 +1,7 @@
|
|||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
COPY ./bashrc /root/.bashrc
|
||||||
|
COPY ./inputrc /root/.inputrc
|
||||||
|
COPY ./index.html /var/www/html/index.html
|
||||||
|
# COPY ./default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
COPY ./default.conf /etc/nginx/nginx.conf
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
PS1='\e[36m\e[1mNGINX\e[0m:\e[90m\w\e[0m\n$ '
|
||||||
|
bind '"\e[A": history-search-backward'
|
||||||
|
bind '"\e[B": history-search-forward'
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events { worker_connections 1024; }
|
||||||
|
|
||||||
|
http {
|
||||||
|
upstream docker-api {
|
||||||
|
server basex:8984;
|
||||||
|
}
|
||||||
|
upstream docker-client {
|
||||||
|
server client:8988;
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-NginX-Proxy true;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
root /var/www/html;
|
||||||
|
index index.html;
|
||||||
|
charset utf-8;
|
||||||
|
server_name dev.gdp.fr;
|
||||||
|
|
||||||
|
access_log on;
|
||||||
|
error_log /var/log/nginx/error.log error;
|
||||||
|
|
||||||
|
sendfile off;
|
||||||
|
|
||||||
|
client_max_body_size 100m;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
rewrite ^/api/(.*) /$1 break;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_pass http://docker-api;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /client {
|
||||||
|
rewrite ^/client/(.*) /$1 break;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_pass http://docker-client;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Proxy</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/api">api</a></li>
|
||||||
|
<li><a href="/client">client</a></li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
set show-all-if-ambiguous on
|
||||||
|
set completion-ignore-case on
|
||||||
@@ -12,6 +12,8 @@ services:
|
|||||||
- 1984:1984
|
- 1984:1984
|
||||||
- 8984:8984
|
- 8984:8984
|
||||||
working_dir: "/srv/basex"
|
working_dir: "/srv/basex"
|
||||||
|
networks:
|
||||||
|
- api
|
||||||
|
|
||||||
client:
|
client:
|
||||||
build: ./Docker/client
|
build: ./Docker/client
|
||||||
@@ -23,7 +25,28 @@ services:
|
|||||||
working_dir: "/app"
|
working_dir: "/app"
|
||||||
depends_on:
|
depends_on:
|
||||||
- basex
|
- basex
|
||||||
|
networks:
|
||||||
|
- client
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
build: ./Docker/nginx/
|
||||||
|
ports:
|
||||||
|
- 8999:80
|
||||||
|
volumes:
|
||||||
|
- "${LOG_ROOT}:/var/log:rw"
|
||||||
|
# working_dir: "/var/www/html"
|
||||||
|
depends_on:
|
||||||
|
- basex
|
||||||
|
- client
|
||||||
|
networks:
|
||||||
|
- api
|
||||||
|
- client
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
basex-home:
|
basex-home:
|
||||||
# client-home:
|
# client-home:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
api:
|
||||||
|
client:
|
||||||
|
|||||||
Reference in New Issue
Block a user