caprover / nginx-redirect

A very simple redirector using nginx and Docker
11 stars 4 forks source link

Ability to disable default app domain #5

Closed darrylmorley closed 1 year ago

darrylmorley commented 1 year ago

When using this in Caprover I am unable to block the Caprover generated domain with:

server {
    listen 443;
    server_name {subdomain}.server.{domain}.com;
    return 404;
}

How can this be achieved please?

githubsaturn commented 1 year ago

Looks like you mentioned here that you were able to resolve the issue, is this a different problem? https://github.com/caprover/caprover/issues/642#issuecomment-1329304090

darrylmorley commented 1 year ago

Hi @githubsaturn

The link that you attached does normally work. But, doesn't in an app using nginx-redirect unfortunately, or at least isn't working on instances in my server.

githubsaturn commented 1 year ago

doesn't in an app using nginx-redirect unfortunately

I am confused. It's should not be possible. The block in the link above gets executed before the request makes it to the app! So it does not matter what the underlying app is (nginx redirect, or anything else)

What exactly are you trying to achieve? Assuming your instance is captain.something.domain.com, there is an app called nginx-redirect-app and what do you want to do?