Ask Your Question
2

[devstack] enabling CORS

asked 2017-01-06 00:45:27 -0600

How can I enable CORS in devstack?

Configuration is explained here, but I'm not sure if there's a way to apply it globally in local.conf: http://docs.openstack.org/admin-guide/cross-project-cors.html#enabling-cors-with-configuration (http://docs.openstack.org/admin-guide...)

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-08 08:19:05 -0600

I figured out how to do it. We need to specify the file we want to affect in local.conf, as this guide indicates: http://docs.openstack.org/developer/devstack/configuration.html (http://docs.openstack.org/developer/d...)

So here you can see an example that enables CORS and modifies a couple of optional settings in various OpenStack APIs (in this case, my javascript development environment at localhost:3000):

[[post-config|$KEYSTONE_CONF]]
[cors]
allowed_origin = http://localhost:3000
max_age = 3600
allow_methods = GET,POST,PUT,DELETE

[[post-config|$GLANCE_API_CONF]]
[cors]
allowed_origin = http://localhost:3000
max_age = 3600
allow_methods = GET,POST,PUT,DELETE

[[post-config|$NOVA_CONF]]
[cors]
allowed_origin = http://localhost:3000
max_age = 3600
allow_methods = GET,POST,PUT,DELETE

This should become handy for frontend developers using javascript to interact with OpenStack.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-01-06 00:45:27 -0600

Seen: 126 times

Last updated: Jan 08 '17