Introducing Edgio Applications v7Find out what's new.
Edgio
Edgio

edgio.config.js Configuration

The edgio.config.js config file in your app’s root directory contains configuration options that control how your app runs on Edgio. This file is automatically created when you run edgio init. It should export an object with the following properties:

origins

The origins config is an array of objects whose properties are:
PropertyTypeDescription
nameString(Required) The origin name refered within the router.
override_host_headerStringThe host header sent from the browser when connecting to the origin. This is useful when you want to connect to a backend that is configured to serve content from a different domain than the one that the browser is connecting to. For example, if you want to connect to a backend that is configured to serve content from example.com but the browser is connecting to www.example.com, you can set override_host_header to example.com to ensure that the backend receives the correct host header.
hostsObject[]An array of objects that define how Edgio will proxy requests for this origin configuration. requests.
hosts[].locationObjectContains properties that define the location to which Edgio will proxy requests for this origin configuration.
hosts[].location.hostnameString(Required) The domain name or IP address of the origin server
hosts[].location.portNumberThe port on which the backend receives https requests. Defaults to 443 but you can specify any other acceptable port value. Note that specifying 80 has no special meaning as Edgio will never send secured requests to unsecured backends. To enable HTTP traffic on a backend you must have a route matching http protocol in your router and serve content from that route. All HTTP traffic assumes port 80 on the backend.
shieldsObjectDefines how Edgio will shield your origin configuration.
shields.apacStringThe POP code for the Asia Pacific shield.
shields.emeaStringThe POP code for the Europe, Middle East, and Africa shield.
shields.us_westStringThe POP code for the US West shield.
shields.us_eastStringThe POP code for the US East shield.
tls_verifyObjectAn object that specifies how Edgio should verify the TLS certificate presented by the origin.
tls_verify.use_sniBooleanWhether to use SNI when connecting to the origin. Defaults to false.
tls_verify.sni_hint_and_strict_san_checkStringSNI hint and enforce origin SAN/CN checking.
tls_verify.allow_self_signed_certsBooleanWhether to allow self-signed certificates. Defaults to false.
tls_verify.pinned_certsString[]An array of SHA256 hashes of pinned certificates.

connector

The name of the connector package corresponding to the framework your app uses, or the path to a directory that implements the connector interface.
Example
To use a connector package:
JavaScript
1module.exports = {
2 connector: '@edgio/next',
3};
To implement a connector directly within your project:
JavaScript
1// this directory should have build.js, prod.js, and dev.js
2module.exports = {
3 connector: './path/to/connector/dir',
4};

routes

The path to your routes file relative to the root of your app. Defaults to routes.js.

staticAssets

The staticAssets config is an array of objects determining how Edgio handles static assets in your app configured with the following properties:
PropertyTypeDescription
permanentBooleanSet to true if the file has a hash in path so that it can be considered unique across deployments.
globString[]A list of glob patterns that match or omit files to be included.

serverless

The serverless config Object includes the following properties:
PropertyTypeDescription
includeNodeModulesBooleanIf true, the packages listed in the dependencies property of package.json will be included in the build that is deployed to Edgio.
includeString[]A list of glob patterns that match or omit files to be included in the serverless bundle. Example: lang/**/*

prerenderConcurrency

The maximum number of URLs that will be concurrently prerendered during deployment when static prerendering is enabled. Defaults to 200, which is the maximum allowed value.

sources

A list of glob patterns identifying which source files should be uploaded when running edgio deploy --includeSources. This option is primary used to share source code with Edgio support personnel for the purpose of debugging. If omitted, edgio deploy --includeSources will result in all files which are not gitignored being uploaded to Edgio.
Example:
JavaScript
1sources: [
2 '**/*', // include all files
3 '!(**/secrets/**/*)', // except everything in the secrets directory
4];

Example edgio.config.js

See the full API specification for the edgio.config.js file here.
JavaScript
1// This file was automatically added by edgio init.
2// You should commit this file to source control.
3// Learn more about this file at https://docs.edg.io/guides/performance/cdn_as_code/edgio_config
4module.exports = {
5 // The name of the site in Edgio to which this app should be deployed.
6 // name: 'my-site-name',
7
8 // The name of the team in Edgio to which this app should be deployed.
9 // team: 'my-team-name',
10
11 // Overrides the default path to the routes file. The path should be relative to the root of your app.
12 // routes: 'routes.js',
13
14 origins: [
15 {
16 // The name of the backend origin
17 name: 'origin',
18
19 // Use the following to override the host header sent from the browser when connecting to the origin
20 override_host_header: 'origin.my-site.com',
21
22 // The list of origin hosts to which to connect
23 hosts: [
24 {
25 // The domain name or IP address of the origin server
26 location: 'origin.my-site.com',
27 },
28 ],
29
30 tls_verify: {
31 use_sni: true,
32 sni_hint_and_strict_san_check: 'origin.my-site.com',
33 },
34
35 // Uncomment the following to configure a shield
36 // shields: { us_east: 'DCD' },
37 },
38 ],
39
40 // Uncomment the following to specify environment specific configs
41 // environments: {
42 // production: {
43 // hostnames: [{ hostname: 'www.mysite.com' }],
44 // },
45 // staging: {
46 // hostnames: [{ hostname: 'staging.mysite.com' }],
47 // origins: [
48 // {
49 // name: 'origin',
50 // hosts: [{ location: 'staging-origin.mysite.com' }],
51 // override_host_header: 'staging-origin.mysite.com',
52 // tls_verify: {
53 // use_sni: true,
54 // sni_hint_and_strict_san_check: 'staging-origin.mysite.com',
55 // },
56 // shields: { us_east: 'DCD' },
57 // },
58 // ],
59 // },
60 // },
61
62 // Options for hosting serverless functions on Edgio
63 // serverless: {
64 // // Set to true to include all packages listed in the dependencies property of package.json when deploying to Edgio.
65 // // This option generally isn't needed as Edgio automatically includes all modules imported by your code in the bundle that
66 // // is uploaded during deployment
67 // includeNodeModules: true,
68 //
69 // // Include additional paths that are dynamically loaded by your app at runtime here when building the serverless bundle.
70 // include: ['views/**/*'],
71 // },
72
73 // The maximum number of URLs that will be concurrently prerendered during deployment when static prerendering is enabled.
74 // Defaults to 200, which is the maximum allowed value.
75 // prerenderConcurrency: 200,
76
77 // A list of glob patterns identifying which source files should be uploaded when running edgio deploy --includeSources.
78 // This option is primarily used to share source code with Edgio support personnel for the purpose of debugging. If omitted,
79 // edgio deploy --includeSources will result in all files which are not gitignored being uploaded to Edgio.
80 //
81 // sources : [
82 // '**/*', // include all files
83 // '!(**/secrets/**/*)', // except everything in the secrets directory
84 // ],
85};