| 1 | daemon off;
|
|---|
| 2 | master_process off;
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 | user dibs;
|
|---|
| 6 | worker_processes 12;
|
|---|
| 7 | error_log logs/error.log debug;
|
|---|
| 8 | pid logs/nginx.pid;
|
|---|
| 9 | debug_points abort;
|
|---|
| 10 |
|
|---|
| 11 | events {
|
|---|
| 12 | worker_connections 1024;
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | http {
|
|---|
| 16 | include mime.types;
|
|---|
| 17 | etag off;
|
|---|
| 18 | client_header_timeout 10;
|
|---|
| 19 | client_body_timeout 10;
|
|---|
| 20 |
|
|---|
| 21 | proxy_set_header Host $host:$server_port;
|
|---|
| 22 | proxy_set_header X-Real-IP $remote_addr;
|
|---|
| 23 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|---|
| 24 | proxy_pass_header X-Server-Name;
|
|---|
| 25 | # proxy_set_header Accept-Encoding "";
|
|---|
| 26 | # proxy_pass_header Location;
|
|---|
| 27 |
|
|---|
| 28 | # proxy_buffering off;
|
|---|
| 29 | # client_max_body_size 10m;
|
|---|
| 30 | # client_body_buffer_size 128k;
|
|---|
| 31 | proxy_connect_timeout 300;
|
|---|
| 32 | proxy_send_timeout 300;
|
|---|
| 33 | proxy_read_timeout 300;
|
|---|
| 34 | # proxy_buffers 32 4k;
|
|---|
| 35 | proxy_cache_path /usr/local/nginx/cache keys_zone=static-data:25m;
|
|---|
| 36 | #proxy_set_header X-Forwarded-For $remote_addr;
|
|---|
| 37 | #proxy_set_header X-WAF $hostname;
|
|---|
| 38 | ssl_session_cache shared:SSL:10m;
|
|---|
| 39 | keepalive_timeout 75s;
|
|---|
| 40 | #Gatekeeper:
|
|---|
| 41 | # limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
|
|---|
| 42 | # limit_req_zone $binary_remote_addr zone=twenty:10m rate=20r/s;
|
|---|
| 43 | # limit_req_zone $binary_remote_addr zone=fifty:10m rate=50r/s;
|
|---|
| 44 | # limit_req_log_level info;
|
|---|
| 45 | # limit_req_status 429;
|
|---|
| 46 | #Gatekeeper end
|
|---|
| 47 | #match statuswaf {
|
|---|
| 48 | # #status 200;
|
|---|
| 49 | # #header Content-Type = text/html;
|
|---|
| 50 | # body ~ "WAF";
|
|---|
| 51 | #}
|
|---|
| 52 | upstream X3cluster1-port880 {
|
|---|
| 53 | #zone X3cluster1-port880 10m;
|
|---|
| 54 | ip_hash;
|
|---|
| 55 | server webserver11:880;
|
|---|
| 56 | server webserver12:880 down;
|
|---|
| 57 | }
|
|---|
| 58 | upstream X3cluster1-port8043 {
|
|---|
| 59 | ip_hash;
|
|---|
| 60 | server webserver11:1500;
|
|---|
| 61 | #server webserver11:8043;
|
|---|
| 62 | server webserver12:8043 down;
|
|---|
| 63 | }
|
|---|
| 64 | upstream X3cluster1-port8044 {
|
|---|
| 65 | least_conn;
|
|---|
| 66 | server webserver11:8044;
|
|---|
| 67 | server webserver12:8044 down;
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | #Health check for LoadBalancer.org:
|
|---|
| 71 | server {
|
|---|
| 72 | #listen 5555;
|
|---|
| 73 | listen 5556;
|
|---|
| 74 | index check.txt;
|
|---|
| 75 | location /check.txt {
|
|---|
| 76 | root /usr/local/netsite;
|
|---|
| 77 | }
|
|---|
| 78 | }
|
|---|
| 79 | server {
|
|---|
| 80 | listen 80;
|
|---|
| 81 | server_name webserver.architrade.com;
|
|---|
| 82 | # limit_req zone=twenty burst=5;
|
|---|
| 83 | location ~* ((images|paydeco)\/.+$|\.(jpg|png|gif|jpeg|css|js)$) {
|
|---|
| 84 | proxy_cache static-data;
|
|---|
| 85 | #proxy_buffering on;
|
|---|
| 86 | proxy_cache_valid 200 304 120m;
|
|---|
| 87 | proxy_cache_valid 404 720m;
|
|---|
| 88 | #expires 864000;
|
|---|
| 89 | proxy_pass http://X3cluster1-port880;
|
|---|
| 90 | }
|
|---|
| 91 | location / {
|
|---|
| 92 | # ModSecurityEnabled on;
|
|---|
| 93 | # ModSecurityConfig modsecurity.conf;
|
|---|
| 94 | proxy_pass http://X3cluster1-port880;
|
|---|
| 95 | }
|
|---|
| 96 | }
|
|---|
| 97 | server {
|
|---|
| 98 | listen 443 ssl;
|
|---|
| 99 | server_name webserver.architrade.com;
|
|---|
| 100 | ssl_certificate ssl/cert.crt;
|
|---|
| 101 | ssl_certificate_key com.key;
|
|---|
| 102 | ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM;
|
|---|
| 103 | #ssl_prefer_server_ciphers on;
|
|---|
| 104 | location / {
|
|---|
| 105 | ModSecurityEnabled on;
|
|---|
| 106 | ModSecurityConfig modsecurity.conf;
|
|---|
| 107 | proxy_pass http://X3cluster1-port8043;
|
|---|
| 108 | proxy_redirect off;
|
|---|
| 109 | }
|
|---|
| 110 | }
|
|---|
| 111 | }
|
|---|