I am running nginx and django on my server, and I have cdn, I setted up cdn but now the issue is how to configure /etc/nginx/sites-available/default few minutes ago my default file looks like this ->
location /static/ { root /home/user/env/; }
but now I have to change them to successfully pull the static files from cdn, But I could not find any resource for this, can any one help me for this to me ?
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!
Unless you’re CDN is different from the majority, most only require that you use either a specific URI that they provide, or a CNAME which masks the URI with your own custom sub-domain. With that in hand, you’d simply link to your static files.
So, for example, if they provide you with a link that looks like:
https://username.mycdn.com
and you’d normally access your CDN files using:
https://mysite.com/static
Then you’d simply link to the static files using the CDN URI instead of your domain, like so (as an example):
https://username.mycdn.com/static/file.css
You wouldn’t actually set this up through NGINX. This is something you setup either in your HTML, CSS, or JS files – wherever you link to static files.
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.