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

Deploying on a machine with nginx #680

Open
awaisjafar opened this issue Mar 11, 2024 · 3 comments
Open

Deploying on a machine with nginx #680

awaisjafar opened this issue Mar 11, 2024 · 3 comments

Comments

@awaisjafar
Copy link

Having a hard time trying to deploy this on a GCP machine that has nginx setup and already serving a couple of websites. Is there a guide that i can follow or do i have to prune the docker-compose files?

@PhilippWu
Copy link
Contributor

Trying to install it on a server with plesk so having a similar issue - I think its because nginx and apache blocking port 443 and 80

Is there a way to let traefik listen on 8081 (secure) and 8080 non secure?

@sourabhsinha396
Copy link

@awaisjafar What's the exact issue you are facing with gcp + nginx ?

  1. Is the request reaching nginx ? Are you getting nginx access logs
  2. docker pruning is our of context but if you see lots of dangling docker images you should prune.

@bereydev
Copy link

Hey @awaisjafar @PhilippWu I don't think the current issue you are facing is linked to GCP, nginx or Plesk specifically but most likely from your understanding of how Traefik works.

As mentioned by @sourabhsinha396 it would be great to have a bit more context on your respective issues, I would be happy to help further. In the meantime with the absence of context I will suppose that you followed the deployment documentation of repo and that you are using the current docker-compose.yml file to deploy the stack.

The docker-compose.yml file in this template is designed with the assumption that the stack is not directly exposed on the server. Instead, Traefik acts as the public-facing interface, managing access to the services within the stack.

In your case, @awaisjafar, it seems your GCP instance uses Nginx as the public interface. To make this work, you have two options depending on how you want to configure your services:

  1. Connect Nginx to the Traefik Proxy
    • Modify your Nginx configuration to route traffic to the Traefik proxy.
    • Ensure Traefik is configured to expose the desired services to Nginx.
    • Be cautious with port configuration to avoid conflicts with other services or websites already hosted on your machine.

This approach allows you to retain Traefik’s features, such as automatic SSL certificate management, but requires careful configuration of Nginx to work alongside Traefik.

  1. Bypass Traefik and Use Nginx Directly
    • Modify your Nginx configuration to route traffic directly to your services, bypassing Traefik entirely.
    • Update the docker-compose.yml file to expose the services you need on appropriate ports.

While this simplifies the network setup, it means you’ll need to handle SSL certificates (for HTTPS) manually or configure Nginx to manage them, which can add complexity to your deployment.

Final Recommendation

If you’re already familiar with Traefik, option 1 is generally preferable as it leverages Traefik’s strengths (like SSL automation). However, if your current Nginx setup is well-established (or not editable) and you want to minimize changes, option 2 might be more straightforward.

PS: Keep in mind that this answer may be a bit off topic since the initial post does not provide with a lot of context 🫣

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

4 participants