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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
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.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
