SHOW:
|
|
- or go back to the newest paste.
| 1 | user www; | |
| 2 | worker_processes 8; | |
| 3 | ||
| 4 | pid /var/run/nginx.pid; | |
| 5 | error_log /var/log/nginx/error_log; | |
| 6 | ||
| 7 | events {
| |
| 8 | worker_connections 1024; | |
| 9 | } | |
| 10 | ||
| 11 | ||
| 12 | http {
| |
| 13 | include /etc/nginx/mime.types; | |
| 14 | #include config for virtual hosts | |
| 15 | #include /etc/nginx/sites/*; | |
| 16 | default_type application/octet-stream; | |
| 17 | server_names_hash_max_size 1024; | |
| 18 | server_names_hash_bucket_size 1024; | |
| 19 | access_log /var/log/nginx/access_log; | |
| 20 | ||
| 21 | server {
| |
| 22 | error_log /var/log/nginx/nginx_global_error; | |
| 23 | access_log /var/log/nginx/nginx_global_access; | |
| 24 | listen 80; | |
| 25 | #server_name _; | |
| 26 | ||
| 27 | location ~.*\.(gif|jpg|jpeg|png|bmp|swf)$ | |
| 28 | {
| |
| 29 | expires 24h; | |
| 30 | if (!-f $request_filename) {
| |
| 31 | break; | |
| 32 | proxy_pass http://127.0.0.1:8000; | |
| 33 | } | |
| 34 | } | |
| 35 | ||
| 36 | location ~.*\.(js|css)?$ | |
| 37 | {
| |
| 38 | expires 1h; | |
| 39 | if (!-f $request_filename) {
| |
| 40 | break; | |
| 41 | proxy_pass http://127.0.0.1:8000; | |
| 42 | } | |
| 43 | } | |
| 44 | ||
| 45 | location / {
| |
| 46 | proxy_pass http://127.0.0.1:8000; | |
| 47 | proxy_redirect off; | |
| 48 | proxy_set_header Host $host; | |
| 49 | proxy_set_header X-Real-IP $remote_addr; | |
| 50 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| 51 | - | location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ |
| 51 | + | |
| 52 | client_body_buffer_size 8k; | |
| 53 | proxy_connect_timeout 90; | |
| 54 | proxy_send_timeout 90; | |
| 55 | #proxy_read_timeout 90; | |
| 56 | - | location ~ .*\.(js|css)?$ |
| 56 | + | |
| 57 | #proxy_busy_buffers_size 64k; | |
| 58 | proxy_temp_file_write_size 64k; | |
| 59 | } | |
| 60 | ||
| 61 | #location ~ .*\.(php|php5)?$ | |
| 62 | #{
| |
| 63 | # #fastcgi_pass unix:/tmp/php-cgi.sock; | |
| 64 | # fastcgi_pass 127.0.0.1:9000; | |
| 65 | # fastcgi_index index.php; | |
| 66 | # include fastcgi_params; | |
| 67 | #} | |
| 68 | ||
| 69 | #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ | |
| 70 | #{
| |
| 71 | # expires 24h; | |
| 72 | #} | |
| 73 | ||
| 74 | #location ~ .*\.(js|css)?$ | |
| 75 | #{
| |
| 76 | # expires 1h; | |
| 77 | #} | |
| 78 | } | |
| 79 | ||
| 80 | #server {
| |
| 81 | # listen 80; | |
| 82 | # | |
| 83 | # server_name localhost; | |
| 84 | # | |
| 85 | # charset utf-8; | |
| 86 | # | |
| 87 | # location / {
| |
| 88 | #root /home/lpfan; | |
| 89 | #index index.php index.html index.htm; | |
| 90 | ######apache backend configuration###### | |
| 91 | #proxy_pass http://127.0.0.1:8080/; #ip and port for listning apache | |
| 92 | #proxy_redirect off; | |
| 93 | #proxy_set_header Host $host; | |
| 94 | #proxy_set_header X-Real-IP $remote_addr; | |
| 95 | #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| 96 | #client_max_body_size 10m; | |
| 97 | #client_body_buffer_size 128k; | |
| 98 | #proxy_connect_timeout 90; | |
| 99 | #proxy_send_timeout 90; | |
| 100 | #proxy_read_timeout 90; | |
| 101 | #proxy_buffer_size 4k; | |
| 102 | #proxy_buffers 4 32k; | |
| 103 | #proxy_busy_buffers_size 64k; | |
| 104 | #proxy_temp_file_write_size 10m; | |
| 105 | ||
| 106 | # } | |
| 107 | # | |
| 108 | # error_page 404 /404.html; | |
| 109 | # | |
| 110 | # location = /404.html {
| |
| 111 | # root /usr/share/nginx/html; | |
| 112 | # } | |
| 113 | ||
| 114 | # redirect server error pages to the static page /50x.html | |
| 115 | # | |
| 116 | # error_page 500 502 503 504 /50x.html; | |
| 117 | # location = /50x.html {
| |
| 118 | # root /usr/share/nginx/html; | |
| 119 | # } | |
| 120 | ||
| 121 | # location ~ \.php$ {
| |
| 122 | # root html; | |
| 123 | # fastcgi_pass 127.0.0.1:9000; | |
| 124 | # fastcgi_index index.php; | |
| 125 | # fastcgi_param SCRIPT_FILENAME /home/lpfan$fastcgi_script_name; | |
| 126 | # include fastcgi_params; | |
| 127 | # } | |
| 128 | ||
| 129 | ||
| 130 | #} | |
| 131 | ||
| 132 | ||
| 133 | # another virtual host using mix of IP-, name-, and port-based configuration | |
| 134 | # | |
| 135 | #server {
| |
| 136 | # listen 8000; | |
| 137 | # listen somename:8080; | |
| 138 | # server_name somename alias another.alias; | |
| 139 | ||
| 140 | # location / {
| |
| 141 | # root html; | |
| 142 | # index index.html index.htm; | |
| 143 | # } | |
| 144 | #} | |
| 145 | ||
| 146 | ||
| 147 | # HTTPS server | |
| 148 | # | |
| 149 | #server {
| |
| 150 | # listen 443; | |
| 151 | # server_name localhost; | |
| 152 | ||
| 153 | # ssl on; | |
| 154 | # ssl_certificate cert.pem; | |
| 155 | # ssl_certificate_key cert.key; | |
| 156 | ||
| 157 | # ssl_session_timeout 5m; | |
| 158 | ||
| 159 | # ssl_protocols SSLv2 SSLv3 TLSv1; | |
| 160 | # ssl_ciphers HIGH:!aNULL:!MD5; | |
| 161 | # ssl_prefer_server_ciphers on; | |
| 162 | ||
| 163 | # location / {
| |
| 164 | # root html; | |
| 165 | # index index.html index.htm; | |
| 166 | # } | |
| 167 | #} | |
| 168 | ||
| 169 | } | |
| 170 | ||
| 171 | ||
| 172 |