| 1 | user daemon daemon;
|
|---|
| 2 | worker_processes 4;
|
|---|
| 3 |
|
|---|
| 4 | error_log logs/error.log ;
|
|---|
| 5 | #error_log logs/error.log notice;
|
|---|
| 6 | #error_log logs/error.log info;
|
|---|
| 7 |
|
|---|
| 8 | pid logs/nginx.pid;
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | events {
|
|---|
| 12 | use epoll;
|
|---|
| 13 | worker_connections 1024;
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | http {
|
|---|
| 18 | proxy_cache_path /home2/cache2 levels=1:2 keys_zone=STATIC:1000m
|
|---|
| 19 | inactive=13h max_size=20g;
|
|---|
| 20 |
|
|---|
| 21 | #resolver 8.8.8.8;
|
|---|
| 22 | include mime.types;
|
|---|
| 23 | default_type application/octet-stream;
|
|---|
| 24 |
|
|---|
| 25 | log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|---|
| 26 | '$status $body_bytes_sent "$http_referer" '
|
|---|
| 27 | '"$http_user_agent" "$http_x_forwarded_for"';
|
|---|
| 28 |
|
|---|
| 29 | #access_log logs/access.log main;
|
|---|
| 30 | access_log off;
|
|---|
| 31 |
|
|---|
| 32 | server_tokens off;
|
|---|
| 33 | sendfile on;
|
|---|
| 34 | tcp_nopush on;
|
|---|
| 35 |
|
|---|
| 36 | #keepalive_timeout 0;
|
|---|
| 37 | keepalive_timeout 65;
|
|---|
| 38 |
|
|---|
| 39 | index index.php index.htm index.html ;
|
|---|
| 40 | server_name_in_redirect off;
|
|---|
| 41 | client_header_timeout 10m;
|
|---|
| 42 | client_body_timeout 10m;
|
|---|
| 43 | send_timeout 10m;
|
|---|
| 44 | fastcgi_connect_timeout 300;
|
|---|
| 45 | fastcgi_send_timeout 30000;
|
|---|
| 46 | fastcgi_read_timeout 300;
|
|---|
| 47 | client_max_body_size 50m;
|
|---|
| 48 | client_header_buffer_size 1k;
|
|---|
| 49 | large_client_header_buffers 4 4k;
|
|---|
| 50 |
|
|---|
| 51 | gzip on;
|
|---|
| 52 | gzip_min_length 1100;
|
|---|
| 53 | gzip_buffers 4 8k;
|
|---|
| 54 | gzip_types text/plain;
|
|---|
| 55 |
|
|---|
| 56 | output_buffers 1 32k;
|
|---|
| 57 | postpone_output 1460;
|
|---|
| 58 |
|
|---|
| 59 | server {
|
|---|
| 60 | listen 8080;
|
|---|
| 61 | #access_log off;
|
|---|
| 62 | server_name 61.74.61.23 122.227.135.135;
|
|---|
| 63 | root /home2/wwwdata/default;
|
|---|
| 64 | access_log logs/default.log main;
|
|---|
| 65 | error_page 404 http://www.zhaokunyao.com;
|
|---|
| 66 |
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | server {
|
|---|
| 70 | #main.
|
|---|
| 71 | listen 8080;
|
|---|
| 72 | server_name www.ads119.com;
|
|---|
| 73 | charset utf-8;
|
|---|
| 74 | access_log off;
|
|---|
| 75 | error_log logs/ttttt debug_http;
|
|---|
| 76 | location / {
|
|---|
| 77 | proxy_pass http://www.ads119.com;
|
|---|
| 78 | proxy_set_header Host $host:8080;
|
|---|
| 79 | proxy_set_header X-Real-IP $remote_addr;
|
|---|
| 80 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|---|
| 81 | proxy_cache STATIC;
|
|---|
| 82 | #proxy_cache_key $proxy_host$request_uri;
|
|---|
| 83 | proxy_cache_valid 200 3h;
|
|---|
| 84 | proxy_cache_use_stale error timeout invalid_header updating
|
|---|
| 85 | http_500 http_502 http_503 http_504;
|
|---|
| 86 | }
|
|---|
| 87 |
|
|---|
| 88 | location ~ /\.ht {
|
|---|
| 89 | deny all;
|
|---|
| 90 | }
|
|---|
| 91 |
|
|---|
| 92 | if ( $fastcgi_script_name ~ \..*\/.*php ) {
|
|---|
| 93 | return 403;
|
|---|
| 94 | }
|
|---|
| 95 | }
|
|---|
| 96 |
|
|---|
| 97 | }
|
|---|