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.

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

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.