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

Docker run behind proxy #148

Open
mattgaviota opened this issue Oct 10, 2024 · 3 comments
Open

Docker run behind proxy #148

mattgaviota opened this issue Oct 10, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@mattgaviota
Copy link

mattgaviota commented Oct 10, 2024

There is a way to setup kerberos agent to work behind a nginx proxy in the same server on subfolders? i tried differents configuration on nginx without luck.

@cedricve cedricve self-assigned this Oct 10, 2024
@cedricve cedricve added the question Further information is requested label Oct 10, 2024
@cedricve
Copy link
Member

hey @mattgaviota can you elaborate a bit more on the use case?

@mattgaviota
Copy link
Author

Yes @cedricve, thanks for asking.

I have been trying kerberos agents on docker with kerberos hub pro. For that, i used a docker compose with the agents i needed, then with a nginx i made a reverse proxy to had agent1.mydomain.com, agent2.mydomain.com and so on.

This solution works perfectly, but i noticed that if i want to add more agents, i'll have to do all the configuration, including a new service, new server and a new subdomain.

For those reason i tried to make a single server on nginx, and had different location for different agents, something like agents.mydomain.com/agent1, agents.mydomain.com/agent2 and so on, and at least avoid the subdomain part. And that configuration i couldn't make it work because i always miss something, 404 errors, redirects, etc.

Thanks in advance, sorry if my english is not clear

@andp97
Copy link
Contributor

andp97 commented Nov 28, 2024

Hi @mattgaviota,

I encountered a similar issue with 404 errors and redirects when setting up a reverse proxy.

Have you tried setting the Host header to ensure proper routing?

Here’s an example NGINX configuration (converted from my setup using Caddy as a reverse proxy):

server {
    listen 80;
    server_name agents.mydomain.com;

    location /agent1/ {
        proxy_pass http://agent1.internal/;
        proxy_set_header Host $host;  # Prevent redirect issues
        
        # Additional configuration...
    }

    location /agent2/ {
        proxy_pass http://agent2.internal/;
        proxy_set_header Host $host;  # Prevent redirect issues
        
        # Additional configuration...
    }
}

Let me know if this works for your setup!

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

No branches or pull requests

3 participants