How do I edit the Templates?

Hello, I am currently on a Nginx Server and using Wordpress. I want to make some changes to the /home/user/conf/web/domains/nginx.conf file. I know that I need to make those changes to the template and I have located the template at /usr/local/hestia/data/templates/web/nginx but I am confused to which template to I make the changes and shall I copy all the data from nginx.conf or just make changes to whatever I want?

https://docs.hestiacp.com/admin_docs/web.html#how-do-web-templates-work

Create a copy from an existing template (Both tpl and stpl)
And give it a different name and change it in the edit web domain page.

1 Like

According to the changes I want to make, the plugin supporter asks me to add this to the nginx.conf file.

# WebP Express rules
# --------------------
location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
  add_header Vary Accept;
  expires 365d;
  if ($http_accept !~* "webp"){
    break;
  }
  try_files
    /wp-content/webp-express/webp-images/doc-root/$uri.webp
    $uri.webp
    /wp-content/plugins/webp-express/wod/webp-on-demand.php?xsource=x$request_filename&wp-content=wp-content
    ;
}

# Route requests for non-existing webps to the converter
location ~* ^/?wp-content/.*\.(png|jpe?g)\.webp$ {
    try_files
      $uri
      /wp-content/plugins/webp-express/wod/webp-realizer.php?xdestination=x$request_filename&wp-content=wp-content
      ;
}
# ------------------- (WebP Express rules ends here)

Should I add this to the new named and copied template or should I make other changes as well?

Add them to the new and copied template should be enough…

Okay Thanks

Hey Eris! I am sorry to disturb again but if you find time, can you help me with this please?
Following is the rule that I have been provided by WebP Express documentation for enabling webp in their server, however it isn’t working.

# WebP Express rules
# --------------------
location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
  add_header Vary Accept;
  expires 365d;
  if ($http_accept !~* "webp"){
    break;
  }
  try_files
    /wp-content/webp-express/webp-images/doc-root/$uri.webp
    $uri.webp
    /wp-content/plugins/webp-express/wod/webp-on-demand.php?xsource=x$request_filename&wp-content=wp-content
    ;
}

# Route requests for non-existing webps to the converter
location ~* ^/?wp-content/.*\.(png|jpe?g)\.webp$ {
    try_files
      $uri
      /wp-content/plugins/webp-express/wod/webp-realizer.php?xdestination=x$request_filename&wp-content=wp-content
      ;
}
# ------------------- (WebP Express rules ends here)

I am adding this just below include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*; in my copied template. If possible and you have any idea, please let me know.