Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.63 KB | None | 0 0
  1. error_log   /var/www/example.com/shared/log/nginx_error_club.log;
  2.  
  3. proxy_cache_path /var/www/example.com/current/public/cache/www.example.com levels=1:2 keys_zone=examplecom_cache:10m max_size=10g  inactive=60m use_temp_path=off;
  4.  
  5. upstream example-com {
  6.   server unix:/var/www/example.com/shared/puma.sock;
  7. }
  8.  
  9. server {
  10.    server_name  example.com;
  11.    rewrite ^(.*) http://www.example.com$1 permanent;
  12.  }
  13.  
  14. server {
  15.   listen 80;
  16.   server_name www.example.com;
  17.   root /var/www/example.com/current/public;
  18.   index index.html;
  19.   try_files $uri/index.html $uri @app;
  20.  
  21.  location / {
  22.  
  23.     proxy_cache examplecom_cache;
  24.     proxy_cache_revalidate on;
  25.     proxy_cache_min_uses 1;
  26.     proxy_cache_use_stale error timeout updating http_500 http_502 http_503    http_504;
  27.     proxy_cache_lock on;
  28.  
  29.     proxy_set_header Host $host;
  30.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  31.     proxy_redirect off;
  32.     try_files $uri /cache/$host/$uri /cache/$host/$uri.html  @app;
  33.   }
  34.   location @app {
  35.     proxy_set_header Host $host;
  36.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  37.     proxy_redirect off;
  38.  
  39.     proxy_pass http://example-com; # match the name of upstream directive which is defined above
  40.   }
  41.  
  42.   location ~* ^/assets/ {
  43.     # Per RFC2616 - 1 year maximum expiry
  44.     expires 1y;
  45.     add_header Cache-Control public;
  46.  
  47.     add_header Last-Modified "";
  48.     add_header ETag "";
  49.     break;
  50.   }
  51.  
  52.  
  53.   error_page 500 502 503 504 /500.html;
  54.   location = /500.html {
  55.     root /var/www/example.com/current/public;
  56.   }
  57.   location ~ (wp-admin|wp-login\.php) {
  58.      return 403;
  59.      break;
  60.    }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement