-
MathType
-
WirisQuizzes
-
Nubric
-
CalcMe
-
MathPlayer
-
Store FAQ
-
MathFlow
-
BF FAQ
-
Miscellaneous
-
Wiris Integrations
Configure cross-domain requests
Reading time: 2minConfigure MathType Integration Services to accept requests from frontend integrations hosted on different domains. A cross-domain deployment separates the frontend integration from the MathType Integration Services deployment. Because browsers restrict requests between different origins, you must enable cross-domain requests before the frontend can communicate with MathType Integration Services.
After completing this guide, your frontend integration will be able to communicate with Integration Services across different domains.
Before you begin
Requirements
Make sure you have:
- A working MathType Integration Services deployment.
- Access to the
configuration.inifile. - The list of domains that should be allowed to access your deployment.
Applies to
Self-hosted MathType Integration Services.
Steps
Determine whether cross-domain configuration is required
You only need to configure cross-domain requests when your frontend integration and MathType Integration Services are hosted on different origins. Typical examples include:
- The HTML editor is hosted on one server while MathType Integration Services are hosted on another.
- The editor is embedded in an application running on a different domain.
- Browser security policies block communication between the frontend and Integration Services.
If your frontend integration and Integration Services are hosted on the same origin, no additional configuration is required.
Enable cross-domain requests
Open configuration.ini and enable cross-domain support:
wiriscorsenabled = trueSave the configuration.
Configure the allowed domains
Integration Services use the corsservers.ini file to define which origins are allowed to access the deployment. Locate the file in your Integration Services installation.
| Deployment | Location |
|---|---|
| PHP | <integration>/corsservers.ini |
| Java | <webapp>/WEB-INF/corsservers.ini |
| .NET | <application>/corsservers.ini |
Add one allowed origin per line. For example:
https://editor.example.com
https://cms.example.comOnly the listed origins will be allowed to communicate with your Integration Services deployment.
Apply the configuration
Depending on your deployment, configuration changes may require restarting the service.
| Deployment | Action |
|---|---|
| PHP | Changes are typically applied immediately. |
| Java | Restart the application server. |
| Docker | Restart the container if the configuration file is mounted during startup. |
| .NET | Restart the web application if required by your hosting environment. |
Verify the configuration
Verify that the configuration endpoint returns the expected configuration.
See API services for the endpoint URLs available on your platform.
Verify it worked
Open your HTML editor from one of the configured origins. Then:
- Insert a formula.
- Save the content.
- Reopen the formula for editing.
- Verify that the editor loads successfully.
- Verify that no browser CORS errors are reported.
You can also use your browser's developer tools to confirm that requests to MathType Integration Services are accepted.
Common issues
Cross-domain requests are blocked
Verify that:
-
wiriscorsenabledis set totrue. - The frontend origin has been added to
corsservers.ini. - The configuration has been applied successfully.
Browser CORS errors are still reported
Verify that:
- The configured origins exactly match the frontend URLs, including the protocol (
httporhttps) and port number, if applicable. - Browser caching is not preserving outdated CORS headers.
- The service has been restarted if required by your deployment.
Requests work from one origin but not another
Verify that:
- Every required origin has been added to
corsservers.ini. - All frontend deployments use the expected domain names.
- No origin has been misspelled or omitted.