Hello,
Droplet: Ubuntu Django on 14.04
I want to configure Nginx to serve the admin portion of my Django site over SSL but not the rest of the site. The admin features are at example.com/admin/*. Is there a way to just serve this location over SSL?
Thanks!
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!
Yes, basically what you do is make it redirect the URL when you’re accessing /admin, something like this:
location /admin {
return 301 https://$server_name$request_uri;
}
Then you have a server-block which will handle all the SSL-requests, basically the same as your other server-block for non-SSL traffic, but only listening on SSL. If you choose to combine the two server-blocks into one you have to check every request with an if-statement, which is not recommended.
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.