Spring Cloud - Zuul Proxy is producing a No 'Access-Control-Allow-Origin' ajax response

后端 未结 6 589
别跟我提以往
别跟我提以往 2021-02-04 05:28

Startup Appplication:

@SpringBootApplication
@EnableZuulProxy
public class ZuulServer {

     public static void main(String[] args) {
         new SpringApplica         


        
6条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 06:16

    When your application runs on http://localhost:8383 then you can only make AJAX-calls to http://localhost:8383. Zuul doesn't and cannot change that.

    What Zuul can do is mapping requests for e.g. http://localhost:8383/zuul/ to http://localhost:8080/zuul/. But your browser would have to call http://localhost:8383/zuul/springapp/departments and you have to configure that mapping.

提交回复
热议问题