-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subdirectory Nginx Proxy_pass #334
Comments
What version are you using? |
I am using: in docker-compose I use: image: phpmyadmin |
Thank you ! I think you meant "in the docker-compose network" for "nginx is inside a container and has -p 80:8080 to the outside world" Config to reproduce the errorversion: "3"
services:
phpmyadmin-frontend:
image: phpmyadmin:latest
environment:
PMA_ABSOLUTE_URI: http://localhost:8075/mysql/
nginx:
image: nginx:alpine
volumes:
- "./nginx.conf:/etc/nginx/conf.d/nginx.conf"
ports:
- "8075:8080" server {
listen 8080;
server_name localhost;
location /mysql {
rewrite /mysql/([^/]+) /$1 break;
set $upstream_phpmyadmin phpmyadmin-frontend:80;
proxy_pass http://upstream_phpmyadmin/;
proxy_pass_header Content-Type;
}
} Config to fix the errorI think Source: https://stackoverflow.com/a/47447211/5155484
version: "3"
services:
phpmyadmin-frontend:
image: phpmyadmin:latest
container_name: phpmyadmin-frontend
environment:
PMA_ABSOLUTE_URI: http://localhost:8075/mysql/
nginx:
image: nginx:alpine
volumes:
- "./nginx.conf:/etc/nginx/conf.d/nginx.conf:ro"
ports:
- "8075:8080" server {
listen 8080;
server_name localhost;
set $upstream_phpmyadmin phpmyadmin-frontend:80;
location /mysql {
resolver 127.0.0.11; # Docker internal DNS
rewrite ^/mysql(/.*)$ $1 break;
proxy_pass http://$upstream_phpmyadmin;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
} Url to access: |
Oh, the last / could be the factor, I never tried it that way, thanks. Great, it works.
and yes, there was a $ missing, but tried before correctly. Many thanks :-) |
@ibennetch should we add this example to the documentation? |
Hi,
I found this one #101 but this is not about nginx.
and tried many different ways, but I can't get it right
The PMA_URI is in docker-compose.yml
- PMA_ABSOLUTE_URI=http://10.8.0.1/mysql/
nginx is inside a container and has -p 80:8080 to the outside world
I get the following error in browser (chromium) console:
crbug/1173575, non-JS module files deprecated.
sometimes I got 404 forbidden or not found, e.g. with css/js, tried a lot and couldn't get it to work.
Does somebody know how to solve this?
I try the same setup with an phplapadmin container and it didn't work either.
without subfolder it works.
The text was updated successfully, but these errors were encountered: