Question

I feel so dumb asking this

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

Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
December 10, 2020
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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.