I copy and paste hummingbird code generated for nginx

I copy and paste hummingbird code generated for nginx and it breaks the site si I erase and restore
/etc/nginx/nginx.con#Code
location ~* \.(txt|xml|js)$ {
expires 8d;
}

location ~* \.(css)$ {
expires 8d;
}

location ~* \.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$ {
expires 8d;
}

location ~* \.(jpg|jpeg|png|gif|swf|webp)$ {
expires 8d;
}
#code

Why doesn't it work ?
Thank you

@

  • Michael Bissett

    Hey Laurent_C,

    I'd be best able to answer this with having a deeper look, could you please send in the following via our secure contact form:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress network admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Include SSH details (the key file can be uploaded to a service like Dropbox, and the link to the file can be included in the email)
    - Include the answer to this question:
    -- "Where inside your nginx.conf was that code inserted?"

    IMPORTANT: Please make sure you select "I have a different question" for your topic, so it doesn't go back to the forums - this and the subject line ensure that it gets assigned to me.

    https://premium.wpmudev.org/contact/

    Kind Regards,
    Michael

  • Michael Bissett

    Hey Laurent_C,

    In regards to your email, while I didn't see where inside of the nginx.conf file you placed that code, I'm guessing that it wasn't placed inside of a server block:

    server {
      //code here
    }

    Or inside of another location block (which is something that's required for location directives).

    In the case of Plesk, we're needing to take a different path, that being to insert the lines of code that Hummingbird generates, into this file:

    /var/www/vhosts/system/<domain_name>/conf/vhost_nginx.conf

    (replacing <domain_name> here with the actual name of your domain)

    I've done that for you here, but am still seeing that the browser caching is coming up as disabled, I'll need to bring this up to our Hummingbird developers.

    Kind Regards,
    Michael

    P.S. For anyone reading this later, I got the info on where NGINX stores virtualhost customizations courtesy of this article:

    http://download1.parallels.com/Plesk/PP11/11.5/Doc/en-US/online/plesk-linux-advanced-administration-guide/index.htm?fileName=72064.htm

    The reason for storing it in this file for a domain, is so that your changes aren't wiped out on a reloading of the NGINX configuration.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.