Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error_log /var/www/example.com/shared/log/nginx_error_club.log;
- 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;
- upstream example-com {
- server unix:/var/www/example.com/shared/puma.sock;
- }
- server {
- server_name example.com;
- rewrite ^(.*) http://www.example.com$1 permanent;
- }
- server {
- listen 80;
- server_name www.example.com;
- root /var/www/example.com/current/public;
- index index.html;
- try_files $uri/index.html $uri @app;
- location / {
- proxy_cache examplecom_cache;
- proxy_cache_revalidate on;
- proxy_cache_min_uses 1;
- proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
- proxy_cache_lock on;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_redirect off;
- try_files $uri /cache/$host/$uri /cache/$host/$uri.html @app;
- }
- location @app {
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_redirect off;
- proxy_pass http://example-com; # match the name of upstream directive which is defined above
- }
- location ~* ^/assets/ {
- # Per RFC2616 - 1 year maximum expiry
- expires 1y;
- add_header Cache-Control public;
- add_header Last-Modified "";
- add_header ETag "";
- break;
- }
- error_page 500 502 503 504 /500.html;
- location = /500.html {
- root /var/www/example.com/current/public;
- }
- location ~ (wp-admin|wp-login\.php) {
- return 403;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement