Front and back separation cross-domain problem

during the deployment phase of the project, the front-end call interface is cross-domain. Should you set a reverse proxy on the web server or add cross-domain code on the server? which is better, or is there a better way?

Jun.10,2021

server settings allow cross-domain. Now most of them do this, which is more convenient for


server. Originally, the performance bottleneck is the server, and then you add a proxy to become the minimum value of the server and your own proxy service (and even make many back-end functions useless), just for cross-domain.


Cross-domain is allowed, of course. Simple and convenient.

you can also make them support JSONP

. If

doesn't work, be an agent. As a matter of fact, it's troublesome to play this thing well.


this is not a complete simple solution, but needs to be balanced in many aspects.
if the api provided by the server is stateless and the security requirements are not high, it is best to set the server to run across domains.


personally, there are many ways to solve project cross-domain problems simply. The use of proxy service in the project is not to solve cross-domain problems, such as load balancing, etc., which can be used to kill both cattle and chickens. I think it's a similar reason

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b363b4-2bfdd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b363b4-2bfdd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?