Hi, what is advisable to do to set up a simple file server with CORS support? Thanks in advance
How to add CORS on Nginx static server
ruiorey we don't have any configurable options for our built-in Nginx static apps at this time.
If you need this capability, then you can either:
- Use a PHP+Apache app and configure your CORS stuff in
.htaccess
, or... - Install a private PHP-FPM+Nginx stack and then configure it to serve your static directory instead of PHP, with whatever Nginx configuration you need.
sean I assume adding custom CORS configuration is also not supported for a Proxy server?
HisWatchIsEnded what sort of proxy server do you want to run?
Sorry, I misspoke - I have a proxy port app running on opal8 - not proxy server. I expect there is no custom .htaccess support for proxy port apps.
HisWatchIsEnded a proxy port app is just a port assignment that you can use with any backend server that you want to run. What type of application are you running on your assigned port?
sean It's a node application.
HisWatchIsEnded Ok, right - you won't be able to use .htaccess to configure CORS on a Node app.
If you're using Express as your Node framework then you might be able to use this CORS middleware.
Do I read it correctly that there's currently no way to configure a Django app behind nginx to use CORS, because nginx will not allow these headers from Django app to pass through? That seems to be the issue I am facing atm.
karol There is no way to modify the default Nginx config, but please feel free to send an email to support@opalstack.com so we can check the setup of your Django app and see if we can find a workaround for you.