Skip to content

Custom resolvers not working for HTTPS to HTTP? #312

Open
@NN-Binary

Description

@NN-Binary
const ssl = { http2: false, port: 443, ip: bindIp };
try {
  ssl.key = fs.readFileSync(path.join(CERTS_PATH, 'key.pem'), 'utf8');
  ssl.cert = fs.readFileSync(path.join(CERTS_PATH, 'cert.pem'), 'utf8');
  console.log(`Loaded official certificates for ${DOMAIN}`);
} catch (err) {
  console.error(`Failed to load official certificates: ${err.message}`);
  process.exit(1);
}

// Custom resolver for our official domain (DOMAIN)
const officialResolver = {
  priority: 100,
  fn: (host, url, req) => {

      console.log('debug!')
      return {
        opts: {
          ssl: {
            key: path.join(CERTS_PATH, 'key.pem'),
            cert: path.join(CERTS_PATH, 'cert.pem')
          },
        },

        url: 'http://10.10.8.100:80'
      };

    }

  }

const redbird = require('redbird');
const proxy = new redbird.Redbird({
  port: 80,
  letsencrypt: {
    path: path.join(__dirname, 'certs'),
    port: 9999,
  },
  ssl,
  bunyan: false,
  resolvers: [
    officialResolver, 
    //customDomainResolver
  ],
  cluster: 8 // Enable cluster mode with 8 CPUs
});


};

I have tried a bit of everything but I can't seem to have:

HTTPs using my own cert (that should be in the custom resolver) to HTTP with a custom Resolver.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions