Comments (11)
@TimWolla it is still an issue
from docker-adminer.
@vesamet You misconfigured your proxy_pass
directive. Quoting from the nginx documentation (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass):
If the proxy_pass directive is specified with a URI, then when a request is passed to the server, the part of a normalized request URI matching the location is replaced by a URI specified in the directive:
Replacing proxy_pass http://XX.XX.XX.X:3000/;
with proxy_pass http://XX.XX.XX.X:3000;
should fix the issue for you.
from docker-adminer.
This config works fine for me :
location /adminer {
proxy_pass http://localhost:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
But it doesn't work if pointing to another server like this
location /adminer {
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://XX.XX.XX.X:3000/;
}
It points to domain root like this: https://example.com/?server=localhost&username=username
@TimWolla Do you know a possible fix ? I tried the fastcgi method but it's not working as expected.
Thank you in advance if you happen to have the time!
from docker-adminer.
Is it possible to use a sub-url path instead of only "/" root URL ?
It is. For more specific advice I need to know which image you are using (FastCGI or Standalone?, Which Reverse Proxy or Webserver?).
from docker-adminer.
Standalone
from docker-adminer.
Use a reverse proxy of your choice to map an arbitrary path to the /index.php
of the container.
from docker-adminer.
@TimWolla maybe I'm to stupid, but the following did not work for me:
The Part of my docker_compose.yml
adminer:
image: adminer
container_name: adminer
hostname: adminer
mem_limit: 128m
restart: always
environment:
- TZ=Europe/Berlin
ports:
- 127.0.0.1:8082:8080
depends_on:
- db
The part of my NGINX configuration
location /adminer/ {
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8082/;
}
but the above will not let me login, as after login the page is redirected to /
removing the subfolder.
Maybe you can document this a little more.
thx
from docker-adminer.
@jalogisch I can confirm that adminer generates an absolute redirect, instead of a relative one. I don't think you are able to configure an explicit folder in adminer, thus: Use fastcgi mode which supports this set-up:
location ~ ^/adminer(/.*$|$) {
rewrite ^/adminer$ /adminer/ permanent;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/html/index.php; # this is the important part
fastcgi_pass 127.0.0.1:9000; # host and port goes here
}
from docker-adminer.
Hi @TimWolla is there any way to get this to work with Apache? I have this setting and I am facing the same issue
proxypass /myfolder/adminer http://x.x.x.x:8080
proxypassreverse /myfolder/adminer http://x.x.x.x:8080
<Location /myfolder/adminer>
AllowOverride All
Order allow,deny
Allow from all
</Location>
adminer.css is being fetched from www.example.com/adminer.css instead of www.example.com/myfolder/adminer.css
Other than the style, everything else is working correctly.
from docker-adminer.
@v-nalvarez I don't have any Apache experience, but this looks like you're using the standalone version. Putting Adminer into a subdirectory with this Docker image is only well-supported if you're using FastCGI. See:
from docker-adminer.
Hi @TimWolla is there any way to get this to work with Apache? I have this setting and I am facing the same issue proxypass /myfolder/adminer http://x.x.x.x:8080 proxypassreverse /myfolder/adminer http://x.x.x.x:8080
<Location /myfolder/adminer> AllowOverride All Order allow,deny Allow from all </Location>
adminer.css is being fetched from www.example.com/adminer.css instead of www.example.com/myfolder/adminer.css
Other than the style, everything else is working correctly.
I think I've found the reason why the theme won't load.
The CSS loads the src "adminer.css", so if your path does NOT end with the slash (/), the last part is replaced with "adminer.css".
For simplicity:
Base URL | Theme Request | Is CSS loaded correctly? |
---|---|---|
https://sub.example.tld/sub/db | https://sub.example.tld/sub/adminer.css | Does not load the CSS |
https://sub.example.tld/sub/db/ | https://sub.example.tld/sub/db/adminer.css | Loads the CSS 🎉 |
So it is necessary to FORCE the slash to be present, with configurations like these, for example:
Nginx (not tested):
<Location /sub/db/> # Path ends with slash
AllowOverride All
Order allow,deny
Allow from all
</Location>
Traefik (tested and working as expected):
labels:
traefik.enable: true
traefik.http.routers.adminer.rule: Host(`sub.example.tld`) && PathPrefix(`/sub/db/`) # Path ends with slash
traefik.http.routers.adminer.entrypoints: https
traefik.http.routers.adminer.service: adminer
traefik.http.routers.adminer.middlewares: adminer
traefik.http.services.adminer.loadbalancer.server.port: 8080
traefik.http.middlewares.adminer.stripprefix.prefixes: /sub/db
from docker-adminer.
Related Issues (20)
- vulnerability issue HOT 3
- htpassword access HOT 1
- apk not found HOT 3
- Increase allowed memory HOT 4
- [bug fix] designs/hydra/adminer.css missing, ADMINER_DESIGN: hydra HOT 3
- FYI regarding upstream project status HOT 3
- adminer:4.8.1 | adminer:4.8.1-standalone missing ping curl tools HOT 1
- Security: PHP version HOT 3
- Invalid CSRF token. Send the form again. If you did not send this request from Adminer then close this page. HOT 1
- Sub Queries in search are not executed HOT 1
- Please add an Environment variable which will change the default WebUI port HOT 3
- New 4.8.1 version breaks healthchecks HOT 1
- Cannot add additional php packages in Docker image
- Specifying multiple sets of credentials HOT 2
- how to login sqlite file without password? HOT 1
- Add MariaDB for Supported Driver
- /tiny_mce/tiny_mce.js 404
- [bug] ADMINER_DESIGN: hydra, not show all columns if too much HOT 1
- Getting a "attempt to write a readonly database" error for SQLite db HOT 1
- ADMINER_DEFAULT_SERVER does not work in fastcgi mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-adminer.