| 1 | user nginx;
|
|---|
| 2 | worker_processes 6;
|
|---|
| 3 |
|
|---|
| 4 | error_log /data2/error.log warn;
|
|---|
| 5 | pid /data2/nginx.pid;
|
|---|
| 6 |
|
|---|
| 7 | daemon off;
|
|---|
| 8 |
|
|---|
| 9 | events {
|
|---|
| 10 | worker_connections 16384;
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | http {
|
|---|
| 14 | log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|---|
| 15 | '$status $body_bytes_sent "$http_referer" '
|
|---|
| 16 | '"$http_user_agent" "$http_x_forwarded_for"';
|
|---|
| 17 | access_log off;
|
|---|
| 18 | default_type application/octet-stream;
|
|---|
| 19 | sendfile on;
|
|---|
| 20 | client_body_buffer_size 16k; # default 8K buffer may not be enough for larger requests
|
|---|
| 21 | gzip on;
|
|---|
| 22 |
|
|---|
| 23 | keepalive_timeout 60;
|
|---|
| 24 |
|
|---|
| 25 | upstream backend {
|
|---|
| 26 | server 127.0.0.1:81 max_fails=3 fail_timeout=10s;
|
|---|
| 27 | keepalive 8120;
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | server {
|
|---|
| 31 | listen 443;
|
|---|
| 32 |
|
|---|
| 33 | ssl on;
|
|---|
| 34 | ssl_certificate /data2/crt.pem;
|
|---|
| 35 | ssl_certificate_key /data2/prv.pem;
|
|---|
| 36 |
|
|---|
| 37 | # 1MB is about 4000 session -> 256MB --> 1M sessions
|
|---|
| 38 | ssl_session_cache shared:SSL:256m;
|
|---|
| 39 | ssl_session_timeout 10m;
|
|---|
| 40 | ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
|
|---|
| 41 |
|
|---|
| 42 | #set up preference list, fastest first and disabling very slow
|
|---|
| 43 | ssl_ciphers AES128-SHA:AES256-SHA:RC4:TLSv1:!ADH:!aNULL:!DH:!EDH:!kEDH:!eNULL:!EXP:!NULL;
|
|---|
| 44 |
|
|---|
| 45 | #use my preference list to determine encryption instead of clients
|
|---|
| 46 | ssl_prefer_server_ciphers on;
|
|---|
| 47 |
|
|---|
| 48 | location / {
|
|---|
| 49 | proxy_pass http://backend;
|
|---|
| 50 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|---|
| 51 | proxy_http_version 1.1;
|
|---|
| 52 | proxy_set_header Connection "";
|
|---|
| 53 | }
|
|---|
| 54 | }
|
|---|
| 55 | } |
|---|