Skip to content

Instantly share code, notes, and snippets.

@kekru
Last active November 9, 2022 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kekru/eaa6678b1169441f6dba119d546a67b2 to your computer and use it in GitHub Desktop.
Save kekru/eaa6678b1169441f6dba119d546a67b2 to your computer and use it in GitHub Desktop.
pgAdmin 6.15 does not work with nginx reverse proxy
services:
nginx:
build: .
ports:
- 8080:80
pgadmin:
image: dpage/pgadmin4:6.15
environment:
PGADMIN_DEFAULT_EMAIL: "no-reply@example.com"
PGADMIN_DEFAULT_PASSWORD: "secret"
PGADMIN_LISTEN_PORT: "5050"
PGADMIN_SERVER_JSON_FILE: "/data/servers.json"
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False"
PGADMIN_CONFIG_SERVER_MODE: "False"
SCRIPT_NAME: "/pgadmin4"
volumes:
- ./servers.json:/data/servers.json:ro
postgres:
image: postgres:13.2
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mydb
FROM nginx:1.22.1-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
server {
listen 80;
listen [::]:80;
server_name localhost;
location /pgadmin4 {
proxy_set_header X-Script-Name /pgadmin4;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $host;
proxy_pass http://pgadmin:5050;
proxy_redirect off;
}
}
{
"Servers": {
"1": {
"Name": "Admin",
"Group": "Postgres",
"Username": "postgres",
"Host": "postgres",
"Port": 5432,
"SSLMode": "prefer",
"MaintenanceDB": "postgres"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment