Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- events {
- worker_connections 1024;
- }
- http {
- default_type application/octet-stream;
- log_format response '***$time_local "$request" ($status) [$upstream_cache_status] $upstream_response_time ms ';
- access_log logs/nginx-http_access.log response;
- error_log logs/nginx-http_error.log debug;
- proxy_cache_path /tmp/nginx levels=1:2:1 keys_zone=test_zone:100m inactive=10d max_size=200m;
- proxy_temp_path /tmp/nginxproxy_temp 1 1;
- server {
- listen 8090;
- server_name localhost;
- location ~ /purge(/.*)\.(html|jpg|org|png|css|ico|txt)$ {
- proxy_cache_purge test_zone $1.$2 $2;
- group_clean_cache_purge $http_x_group_clean;
- break;
- }
- location ~ \.(html|jpg|org|png|css|ico|txt)$ {
- proxy_pass http://localhost:8080;
- proxy_cache test_zone;
- proxy_cache_key $uri $1;
- proxy_cache_valid 200 1m;
- proxy_cache_valid 404 400 10m;
- proxy_cache_use_stale timeout updating;
- add_header X-Cache-Status $upstream_cache_status;
- }
- }
- server {
- listen 8080;
- server_name localhost;
- location / {
- root html/static;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement