nginx configuration used on cpanel server

From WebHostingNeeds.com
Jump to: navigation, search
[email protected] [~]# cat /etc/nginx/vhosts/webhostingneeds.com
server {
          error_log /var/log/nginx/vhost-error_log warn;
          listen 18.12.10.100:80;
          server_name webhostingneeds.com www.webhostingneeds.com 18.12.10.100;
          access_log /usr/local/apache/domlogs/webhostingneeds.com-bytes_log bytes_log;
          access_log /usr/local/apache/domlogs/webhostingneeds.com combined;
          root /home/wicked/public_html;
          location / {
          location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
          expires 1d;
          try_files $uri @backend;
          }
          error_page 405 = @backend;
          add_header X-Cache "HIT from Backend";
          proxy_pass http://18.12.10.100:8081;
          include proxy.inc;
          }
          location @backend {
          internal;
          proxy_pass http://18.12.10.100:8081;
          include proxy.inc;
          }
          location ~ .*\.(php|jsp|cgi|pl|py)?$ {
          proxy_pass http://18.12.10.100:8081;
          include proxy.inc;
          }
          location ~ /\.ht {
          deny all;
          }
        }[email protected] [~]#


[email protected] [/etc/nginx]# cat proxy.inc
proxy_buffering off;
proxy_connect_timeout 59s;
proxy_send_timeout   600;
proxy_read_timeout   600;
proxy_buffer_size    64k;
proxy_buffers     16 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_pass_header Set-Cookie;
proxy_redirect     off;
proxy_hide_header  Vary;
proxy_set_header   Accept-Encoding '';
proxy_ignore_headers Cache-Control Expires;
proxy_set_header   Referer $http_referer;
proxy_set_header   Host   $host;
proxy_set_header   Cookie $http_cookie;
proxy_set_header   X-Real-IP  $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
[email protected] [/etc/nginx]#



nginx