• Type:
import type { ServerOptions } from 'node:https';
import type { SecureServerSessionOptions } from 'node:http2';

type Https = ServerOptions | SecureServerSessionOptions;
  • Default: undefined

After configuring this option, you can enable HTTPS Server, and disabling the HTTP Server.


> Local: http://localhost:3000/ > Network:


> Local: https://localhost:3000/ > Network:

Rsbuild enables HTTP/2 server by default. However, when you use server.proxy, the server will downgrade to HTTP/1, because the underlying http-proxy does not support HTTP/2.

Set Certificate

You can manually pass in the certificate and the private key required in the server.https option. This parameter will be directly passed to the createServer method of the https module in Node.js.

For details, please refer to https.createServer.

import fs from 'node:fs';

export default {
  server: {
    https: {
      key: fs.readFileSync('certificates/private.pem'),
      cert: fs.readFileSync('certificates/public.pem'),

The certificates used for local development are typically generated using mkcert. Please read "How to use HTTPS for local development" to learn how to use it.

Self-signed Certificate

For basic configuration requirements, you can add the @rsbuild/plugin-basic-ssl plugin, which will automatically create a self-signed certificate and set server.https option by default.

import { pluginBasicSsl } from '@rsbuild/plugin-basic-ssl';

export default {
  plugins: [pluginBasicSsl()],