Closed rsignell-usgs closed 9 years ago
From the information at http://enable-cors.org/server_tomcat.html, it looks like we need to first upgrade the thredds-dev tomcat /usr/local/usgs-dev/tomcat-thredds
from tomcat 7.0.29 to at least 7.0.41 and then add these lines to the <tomcat>/conf/web.xml
file:
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
``
@gregpike, would you be able to enable CORS on geoport's tomcat and tomcat-dev?
/usr/local/usgs/tomcat-thredds
/usr/local/usgs-dev/tomcat-thredds
I'll try to get this done this afternoon. I'll let you know when it's ready for testing.
It's also possible to enable CORS in your front end web server without touching Tomcat:
http://enable-cors.org/server_apache.html http://enable-cors.org/server_nginx.html
@shane-axiom , this would be a better (higher-level) solution, right? Would this mean we wouldn't have to modify every single tomcat instance?
Yeah, it's a lot cleaner/easier to enable on the web server in my experience.
Sorry for the delay on this; CORS is enabled now.
@gregpike , did you enable it on tomcat or on apache, or?
Enabled in Apache.
@gregpike @rsignell-usgs This does not seem to be working. Are you only enabling certain domains?
@gregpike , we need this working on geoport.whoi.edu as well as geoport-dev.whoi.edu
Enabled on dev. Let me know if you have any problems.
Verified working, can now autoscale datasets: http://axiomdatascience.com/maps/cmg/#map?lg=9bbb30d1-0cdd-477d-9f04-454dd86c635f&p=proj3857&b=google_hybrid
And working in the Cesium-driven Australian National Map now also (this also required CORS). Woo hoo!
@kwilcox chatted me: "the portal autoscale won't work until you have CORS enabled on your server. That allows the portal to request JSON from the geoport ncWMS server" Instructions at: http://enable-cors.org/server.html