Skip to content
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

Symbolic links returning 404 #312

Open
sheen-justin opened this issue May 16, 2024 · 1 comment
Open

Symbolic links returning 404 #312

sheen-justin opened this issue May 16, 2024 · 1 comment

Comments

@sheen-justin
Copy link

Running into an issue where symbolic links in a mounted volume are served as 404. The symlinks are created and exist on the container itself, but the tomcat server does not seem to serve them as normal files and instead returns 404.

Here's a quick way to replicate this behavior:

docker-compose.yml

services:
    test-symlink:
        container_name: test-symlink
        image: tomcat
        ports:
            - "8080:8080"
        volumes:
            - ./app:/usr/local/tomcat/webapps/app
mkdir app
touch app/real-file.txt
ln -s real-file.txt app/symlink.txt
docker compose up

http://localhost:8080/app/real-file.txt > returns 200
http://localhost:8080/app/symlink.txt > returns 404

@yosifkit
Copy link
Member

I think you need to set the allowLinking attribute somewhere in the xml config files: https://tomcat.apache.org/tomcat-9.0-doc/config/resources.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants