Join the community today
Register Now

Wordpress Recommended Nginx Configuration for Comet Cache ?

Discussion in 'Blogs & CMS usage' started by Max, Feb 22, 2018.

  1. Max

    Max Member

    67
    4
    8
    Feb 17, 2018
    Ratings:
    +6
    Local Time:
    3:21 PM
    Hello

    can I use this directive without problems in vhost?

    Code:
    server {
    
      # ↓ See: http://nginx.org/en/docs/http/ngx_http_core_module.html#etag
      # This reduces load on your server by supporting the If-Modified-Since header,
      # since by browsers for static resources.
    
      etag on;
      expires 7d;
      if_modified_since before;
    
      # ↓ See: http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip
      # This enables GZIP compression in Nginx, making all static
      # resources load faster in browsers.
    
      gzip on;
      gzip_vary on;
      gzip_comp_level 6;
      gzip_types text/plain text/xml image/svg+xml # text/html in core already.
        application/rss+xml application/atom+xml application/xhtml+xml
        text/css application/json application/x-javascript
        application/font-otf application/font-ttf;
    
      # Do not allow public access to private cache directory.
      if ($uri ~* /wp\-content/cache/comet\-cache/cache(?:/|$)) {
          return 403;
      }
    
    
    
    thanks
      # Do not allow public access to private cache directory.
      if ($uri ~* /wp\-content/cache/comet\-cache/htmlc/private(?:/|$)) {
          return 403;
      }
    
      # ↓ See: http://davidwalsh.name/cdn-fonts
      # This prevents cross-domain security issues related to fonts.
      # Only needed if you use Static CDN Filters in Comet Cache.
    
      location ~* \.(?:ttf|ttc|otf|eot|woff|woff2|css|js)$ {
          add_header Access-Control-Allow-Origin *;
      }
    
      # ↓ This is optional, but suggested. It's a flag to tell Comet Cache
      # that you completed this Nginx configuration.
    
      location ~* \.php$ {
          fastcgi_param WP_NGINX_CONFIG done;
      }
    }
     
  2. eva2000

    eva2000 Administrator Staff Member

    35,992
    7,897
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,177
    Local Time:
    12:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    everything in your vhost except below is already taken care of in each vhost files staticfiles.conf include file for static files and in nginx.conf for gzip compression

    so only items which Centmin Mod don't cover already are:
    Code (Text):
      if_modified_since before;
     
      # Do not allow public access to private cache directory.
      if ($uri ~* /wp\-content/cache/comet\-cache/cache(?:/|$)) {
         return 403;
      }
    
      # Do not allow public access to private cache directory.
      if ($uri ~* /wp\-content/cache/comet\-cache/htmlc/private(?:/|$)) {
         return 403;
      }
    

    whether they work for your Comet Cache is another matter as I have never used it before.
     
  3. Max

    Max Member

    67
    4
    8
    Feb 17, 2018
    Ratings:
    +6
    Local Time:
    3:21 PM
    Thanks works
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    35,992
    7,897
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,177
    Local Time:
    12:21 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Glad to hear :)
     
..