mirror of
https://github.com/strapi/strapi.git
synced 2025-12-29 08:04:51 +00:00
Merge pull request #7303 from strapi/minor/addKoaProxyConf
Add conf proxy koa variable
This commit is contained in:
commit
3fbd684981
@ -174,7 +174,8 @@ module.exports = ({ env }) => ({
|
||||
| `host` | Host name | string | `localhost` |
|
||||
| `port` | Port on which the server should be running. | integer | `1337` |
|
||||
| `emitErrors` | Enable errors to be emitted to `koa` when they happen in order to attach custom logic or use error reporting services. | boolean | `false` |
|
||||
| `url` | Public url of the server. Required for many different features (ex: reset password, third login providers etc.). Also enables proxy support such as Apache or Nginx, example: `https://mywebsite.com/api`. The url can be relative, if so, it is used with `http://${host}:${port}` as the base url. An absolute url is however **recommended** | string | `''` |
|
||||
| `url` | Public url of the server. Required for many different features (ex: reset password, third login providers etc.). Also enables proxy support such as Apache or Nginx, example: `https://mywebsite.com/api`. The url can be relative, if so, it is used with `http://${host}:${port}` as the base url. An absolute url is however **recommended**.| string | `''` |
|
||||
|`proxy`| Set the koa variable `app.proxy`. When `true`, proxy header fields will be trusted. |boolean|`false`|
|
||||
| `cron` | Cron configuration (powered by [`node-schedule`](https://github.com/node-schedule/node-schedule)) | Object | |
|
||||
| `cron.enabled` | Enable or disable CRON tasks to schedule jobs at specific dates. | boolean | `false` |
|
||||
| `admin` | Admin panel configuration | Object | |
|
||||
|
||||
@ -57,6 +57,8 @@ class Strapi {
|
||||
this.admin = {};
|
||||
this.plugins = {};
|
||||
this.config = loadConfiguration(this.dir, opts);
|
||||
this.app.proxy = this.config.get('server.proxy');
|
||||
|
||||
this.isLoaded = false;
|
||||
|
||||
// internal services.
|
||||
|
||||
@ -37,6 +37,7 @@ const defaultConfig = {
|
||||
server: {
|
||||
host: process.env.HOST || os.hostname() || 'localhost',
|
||||
port: process.env.PORT || 1337,
|
||||
proxy: false,
|
||||
cron: { enabled: false },
|
||||
admin: { autoOpen: false },
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user