Base problem here is, I’m trying to set Discourse up in a droplet to serve comment threads for a site that is hosted elsewhere (as well as create a community). I’ve been getting CORS-related 403 errors because of this setup (you can see discussion regarding the issue here: http://forum.getkirby.com/t/discourse-on-kirby/340).
I’ve ended up determining nginx to be the next thing to try and work on. Problem is, nginx is running within a Docker app, and as a consequence editing it directly would only work as a temporary workaround (I’d need to fix every time I rebuild my app).
I wanna include this (http://enable-cors.org/server_nginx.html) in nginx’s configuration, at building stage (in other words, I need to figure out how to get Docker to include this configuration in the nginx instance it includes in the app). Problem is I know next to nothing about YAML and Docker, so I have no idea where to act. Any pointers?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
There are multiple ways to accomplish what you want to do. Could you provide any more information about how you are running Nginx with Docker? Are you building an image from your own Dockerfile?
Often you would copy the configuration files into the image while building it. Another approach is to bind mount a directory on the host system into the container. Assuming you are using the official Nginx Docker image directly, you could do something like:
docker run --name your-nginx-container -v /local/path/to/nginx.conf.d:/etc/nginx/conf.d:ro -p 80:8080 -d nginx
Where /local/path/to/nginx.conf.d is a directory in the host filesystem. You can then drop additional Nginx configuration files into that directory and they will be used inside of the container. For Nginx to pick up the new configuration, you’ll need to restart the process with:
docker restart your-nginx-container
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.