0

I have deployed two applications in a private JVM/tomcat 8.5.30 on my vps. The one is my ROOT.war and the other one is the admin.war They are accesible from http://example.com and http://example.com/admin

Before I installed a ssl certificate everything worked fine. After installing it and forcing https redirect I am facing a problem with my admin.war (now they are both accesible from https://example.com and https://example.com/admin)

In a lot of jqueries I am getting this error

Access to XMLHttpRequest at 'http: //example.com/admin/add' from origin 'https: //example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Is there any configuration that I can do on my tomcat to solve this?

I would truly appreciate any tip!!!

tim.a
  • 83
  • 1
  • 1
  • 10
  • 1
    Possible duplicate of [Access-Control-Allow-Origin: \* in tomcat](https://stackoverflow.com/questions/12383109/access-control-allow-origin-in-tomcat) – Selaron Mar 21 '19 at 10:35
  • I couldn't find the solution although I read this links. In any case I think I have to configure it via spring security so I opened a new thread here:[link](https://stackoverflow.com/questions/55284078/no-access-control-allow-origin-header-is-present-on-the-requested-resource-sp) – tim.a Mar 21 '19 at 15:46
  • It is [this answer](https://stackoverflow.com/a/17457655/865107) that helpfully links to the [Apache Tomcat CorsFilter configuration documentation](http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter). This allows you to configure required Access-Control headers. – Selaron Mar 21 '19 at 16:55

0 Answers0