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
Rewrite Rules
NGINX rewrite rules are used to change entire or a part of the URL requested by a client. The main motive for changing an URL is to inform the clients that the resources they are looking for have changed its location apart from controlling the flow of executing pages in NGINX.
You can place custom rewrite rules within a file at /usr/local/mediacp/nginx/conf.d/locations.custom
After applying rewrite rules, be sure to reload or restart the nginx service (instructions at top of page).
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;
PHP-FPM Configurations
/usr/local/mediacp/php/etc/php-fpm.d/www.includeAfter applying changes, you need to restart the MediaCP PHP service:
mediacp restart php;