I'm running Apache Guacamole inside Docker and I want to make it publicly accessible using Nginx Proxy Manager.
This is the Docker Stack for Guacamole:
version: "3"
volumes:
mysql:
driver: local
services:
guacamole:
image: guacamole/guacamole:latest
container_name: guacamole_server
restart: always
ports:
- 8080:8080
depends_on:
- mysql
- guacd
environment:
- MYSQL_HOSTNAME=mysql
- MYSQL_PORT=3306
- MYSQL_DATABASE=guacamole
- MYSQL_USER=guacamole
- MYSQL_PASSWORD=secret
- GUACD_HOSTNAME=guacd
- GUACD_PORT=4822
mysql:
image: mysql:latest
container_name: guacamole_mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=guacamole
- MYSQL_USER=guacamole
- MYSQL_PASSWORD=secret
- MYSQL_DATABASE=guacamole
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=guacamole"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- mysql:/var/lib/mysql
guacd:
image: guacamole/guacd:latest
container_name: guacamole_guacd
restart: always
When I access Guacamole via it's local IP on port 8080 everything works perfectly fine.
Then I added a new Proxy Host to Nginx Proxy Manager with the following configuration:
Details:
- Domain Name: (something)
- Scheme: http
- IP: 192.168.123.123
- Port: 8080
- Cache Assets: disabled
- Block Common Exploits: enabled
- Websockets Support: enabled
- Access List: Publicly Accessible
SSL:
- Force SSL: enabled
- HSTS Enabled: enabled
- HTTP/2 Support: enabled
- HSTS Subdomains: disabled
Custom Locations:
- (none)
Advanced:
- (nothing)
So far it still works perfectly fine.
If I now change the configuration: (Grabbed that from https://github.com/jc21/nginx-proxy-manager/issues/104)
Custom Locations:
- Location: /
- Scheme: http
- Forward Hostname: 192.168.123.123/guacamole/
- Port: 8080
- Advanced: (nothing)
Then I get a blank page, but all the source code gets loaded and all requests are status 200. In the console of the browser I see:
Uncaught SyntaxError: expected expression, got '<'
The exact same happens when I instead of the 'Custom Locations' configuration I make my own advanced configuration:
location / {
proxy_pass $forward_scheme://$server:$port/guacamole/;
}
I also tried different configurations here, but I always got that error. I didn't find any hint in a long online research.
Use no 'Custom Location'.
Put this in Advanced:
I believe I had the same problem trying to configure guacamole and recently stumbled upon a solution.
For the Details:
Then, SSL:
So far so good, guacamole would be accessed from example.com/guacamole.
In order to forward the subdirectory so that example.com points to example.com/guacamole the Custom Locations should be:
Meaning, you actually forward the existing domain subdirectory not the actual server IP. I do not know the exact details, but this worked for me after a lot of other tries.