examples and DNS_RESOLVERS fix
This commit is contained in:
@@ -9,12 +9,28 @@ services:
|
||||
- 80:80
|
||||
- 443:443
|
||||
volumes:
|
||||
- ./http-confs:/www
|
||||
- ./letsencrypt:/etc/letsencrypt
|
||||
- ./server-confs:/server-confs
|
||||
environment:
|
||||
- SERVER_NAME=pma.domain.com app.domain.com # replace with your domains
|
||||
- SERVER_NAME=app1.website.com app2.website.com # replace with your domains
|
||||
- SERVE_FILES=no
|
||||
- DISABLE_DEFAULT_SERVER=yes
|
||||
- REDIRECT_HTTP_TO_HTTPS=yes
|
||||
- AUTO_LETS_ENCRYPT=yes
|
||||
|
||||
# TODO : pma + nodeJS ?
|
||||
app1:
|
||||
image: node
|
||||
restart: always
|
||||
working_dir: /home/node/app
|
||||
volumes:
|
||||
- ./js-app:/home/node/app
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
command: bash -c "npm install express && node index.js"
|
||||
|
||||
app2:
|
||||
image: phpmyadmin:apache
|
||||
restart: always
|
||||
environment:
|
||||
- PMA_ARBITRARY=1
|
||||
- PMA_ABSOLUTE_URI=https://app2.website.com
|
||||
|
||||
12
examples/reverse-proxy/js-app/index.js
Normal file
12
examples/reverse-proxy/js-app/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const port = 3000
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World!')
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening at http://localhost:${port}`)
|
||||
})
|
||||
|
||||
14
examples/reverse-proxy/js-app/package.json
Normal file
14
examples/reverse-proxy/js-app/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "js-app",
|
||||
"version": "1.0.0",
|
||||
"description": "demo",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.17.1"
|
||||
}
|
||||
}
|
||||
12
examples/reverse-proxy/server-confs/reverse-proxy.conf
Normal file
12
examples/reverse-proxy/server-confs/reverse-proxy.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
location / {
|
||||
if ($host = app1.website.com) {
|
||||
proxy_pass http://app1:3000$request_uri;
|
||||
}
|
||||
|
||||
if ($host = app2.website.com) {
|
||||
proxy_pass http://app2$request_uri;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user