Skip to content

Knowledgebase

Adding supported Apache and nginx directives in Plesk

plesk, web-hosting

Use the supported Plesk fields for domain-specific Apache or nginx directives so configuration remains attached to the managed domain. Direct edits to generated virtual-host files can disappear during a later reconfiguration and may bypass the panel validation workflow.

Check access and requirements

Identify which server actually handles the request and confirm the syntax for that server. Keep a copy of the current additional directives and a backup of affected application configuration. A directive valid in a global configuration may be invalid inside the domain context.

01 Add supported Apache and nginx directives in Plesk

  1. Open Apache & nginx Settings for the correct domain. Review the existing values before adding a rule.
  2. Locate the appropriate additional-directive field for HTTP, HTTPS or nginx as required. Do not paste a complete server configuration including unrelated listeners and virtual hosts.
  3. Add only the necessary domain-scoped rule. For a redirect or header, account for application and proxy rules that may already produce the same result.
  4. Save and read any syntax-validation error carefully. If validation fails, correct or remove the new rule instead of forcing a server restart.
  5. Test the exact affected URL over the intended protocols and inspect the response. Include an unaffected page and any authentication-sensitive path in the check.

How do I test the new web-server directive?

Confirm the expected status, header or routing behaviour and review the domain error log. Keep the final rule and its purpose in a change record so another administrator understands why it exists.

Resolve setup problems

For a duplicate-location or invalid-context error, use the syntax appropriate to Plesk generated configuration rather than adding more nested blocks blindly. Remove the new directive to recover if it causes a loop or outage. Shared-hosting customers should ask support for a unavailable setting; server administrators should use supported custom templates only when a broader change is intentionally required.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support