Solutions to the inability to dynamically configure Imageurlprefix in Ueditor

Source: Internet
Author: User

Modify the background, because the background picture is uploaded to the attached static resource disk, the foreground is accessed with a separate domain name

So in the ueditor display the picture prefix, only in "Imageurlprefix": Configure the domain name, with the domain name on the encounter trouble, development environment, test environment, production environment domain names are not the same;

The Ueditor in the configuration item is placed in Config.json, as follows:

The problem is that each time you submit version control, the Config.json file to ignore the submission, and repeatedly confirm whether the submission is submitted, after the submission will cause the test environment to upload pictures, the image domain prefix is displayed in the production environment domain name, the image is not displayed directly.

So, has been trying to imageurlprefix from the Config.json in the project configuration file to come out, studied for two hours, no fruit.

Finally, through the tortuous way, or let Imageurlprefix get rid of fixed domain name restrictions, the editor of the image domain name prefix is to provide timely display effect, not used in storage.

So, we can take advantage of the current domain name, so that the domain name is kept consistent, no longer worry about the image prefix URL inconsistent situation.

Direct elaboration of the solution ideas:

1. Find Imageurlprefix used place ueditor.all.js, here to get the current domain name

2. Using Nginx's directory proxy mode

3. After modification, re-operate as follows

Look at the HTML code in the editor

In this way, the foreground display can be accessed with a static resource domain name, the background editor can directly use the background domain name

Solutions to the inability to dynamically configure Imageurlprefix in Ueditor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.