I am new to the whole NGINX server so please ignore my complete ignorance.
I use spinupwp with Digital Ocean because I wanted to test out some of our SEO clients on something that wasn’t apache. I have searched high and low, tried going in through Putty, tried going in through sftp, and the console.
I’ve logged in with the root user tried getting to the /etc/nginx/sites-available/ so I can get to it and nothing. It’s like it isn’t even there. So maybe I set something up wrong.
I need to insert the following in the server context of your configuration file so I can serve my images as webp can someone please just point me in the right direction or let me know if I am even close looking in the places I am looking. Ugh I feel like such a newb and that it’s right in front of me and I am just completely missing it.
# BEGIN SMUSH-WEBP
location ~* "wp-content\/(uploads\/)(.*.(?:png|jpe?g))" {
add_header Vary Accept;
set $image_path $2;
if (-f "/sites/plastiwin.com/files/wp-content/smush-webp/disable_smush_webp") {
break;
}
if ($http_accept !~* "webp") {
break;
}
try_files /wp-content/smush-webp/$image_path.webp $uri =404;
}
# END SMUSH-WEBP
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!
Accepted Answer
Hey there @MekaPika,
What is the Linux distribution that you are using?
For example, if you are using Nginx, your Nginx server blocks would be in /etc/nginx/conf.d
rather than the sites-enabled
folder as with Ubuntu servers. Files that end with .conf in that directory will be loaded when Nginx is started.
Also, don’t be afraid to ask! We are a friendly community!
Regards, Bobby
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.