Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@chs-bctest01-v / # cat /etc/nginx/nginx.conf
- user www-data;
- worker_processes 8;
- worker_rlimit_nofile 1024;
- pid /var/run/nginx.pid;
- error_log /var/log/nginx/error.log;
- events {
- worker_connections 1024;
- }
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- access_log /var/log/nginx/access.log;
- sendfile on;
- server_tokens Off;
- types_hash_max_size 1024;
- types_hash_bucket_size 512;
- server_names_hash_bucket_size 64;
- server_names_hash_max_size 512;
- keepalive_timeout 65;
- tcp_nodelay on;
- gzip on;
- gzip_disable "MSIE [1-6]\.(?!.*SV1)";
- gzip_types text/plain
- text/css
- application/x-javascript
- text/xml
- application/xml
- application/xml+rss
- application/javascript
- text/x-js
- text/javascript;
- gzip_vary on;
- gzip_comp_level 6;
- # client_body_temp_path /var/nginx/client_body_temp;
- client_body_temp_path /tmp/cache/imgcache/client_body_temp;
- client_max_body_size 10m;
- client_body_buffer_size 128k;
- proxy_redirect off;
- # proxy_temp_path /var/nginx/proxy_temp;
- proxy_temp_path /tmp/cache/imgcache/proxy_temp;
- proxy_connect_timeout 90;
- proxy_send_timeout 90;
- proxy_read_timeout 90;
- proxy_buffers 32 4k;
- proxy_buffer_size 8k;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_headers_hash_bucket_size 64;
- proxy_cache_path /tmp/cache/imgcache levels=1:2 keys_zone=imgcache:100m max_size=1G inactive=600m;
- include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
- }
- root@chs-bctest01-v / # cat /etc/nginx/sites-enabled/default.conf
- server {
- listen *:80;
- server_name default;
- index index.html index.htm index.php;
- access_log /var/log/nginx/default.access.log combined;
- error_log /var/log/nginx/default.error.log;
- location ~* \.(swf|jpg|jpeg|gif|png|ico|css|pdf|bmp|js)$ {
- proxy_pass http://loadbalance;
- proxy_read_timeout 90;
- proxy_connect_timeout 90;
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_cache imgcache;
- proxy_cache_valid 200 301 302 60m;
- add_header Cache-Control "public";
- add_header Pragma public;
- }
- location ~* \.(swf|jpg|jpeg|gif|png|ico|css|pdf|bmp|js)$ {
- expires 120m;
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- }
- # Don't cache these pages.
- location ~* ^/(wp-admin|wp-login.php) {
- proxy_pass http://loadbalance;
- }
- location / {
- proxy_pass http://loadbalance;
- proxy_read_timeout 90;
- proxy_connect_timeout 90;
- proxy_redirect off;
- }
- location /nginx_status {
- allow 127.0.0.1;
- stub_status on;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement