MediaCP Manual
Custom Web Service Configurations

Last updated 3 months ago

It is possible to apply custom changes to the nginx web server and php service where required.

It is important to follow this guide as the included configuration files for nginx and php are automatically replaced when upgrading the MediaCP.

Nginx Configuration

Direct changes to nginx configuration files outside of the conf.d file will be lost on upgrade.

After applying changes, you can reload the nginx service by running:

/usr/local/mediacp/nginx/sbin/nginx -s reload

HTTP Block

You can apply http level configurations by creating a new file with .http extension within the following path:

/usr/local/mediacp/nginx/conf.d/

Http Block Example

/usr/local/mediacp/nginx/conf.d/50_mychange.http

 server {
      server_name localhost;
      access_log /usr/local/mediacp/log/nginx/custom.log;
      listen 127.0.0.1:2025;
  }

SERVER Block

You can apply server {} level configurations by creating a new file with .conf extension within the following path:

/usr/local/mediacp/nginx/conf.d/

For example,

# nano /usr/local/mediacp/nginx/conf.d/50_mychange.conf

These changes are included in the nginx server {} block

PHP.ini configurations

Direct changes to php.ini configuration file will be lost on upgrade.

You should apply any custom php.ini configurations to the php.include file:

/usr/local/mediacp/php/php.d/custom.ini

After applying changes, you will need to restart the MediaCP PHP service:

mediacp restart php;

Table of Contents