Advertisement
AhmadShamli

My site Vhost

Jul 24th, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.67 KB | None | 0 0
  1. server {
  2.         listen *:80;
  3.     listen *:321;
  4.        
  5.        
  6.         server_name mydomain.com www.mydomain.com;
  7.  
  8.         root   /var/www/mydomain.com/web;
  9.        
  10.        
  11.        
  12.         index index.php index.html index.htm index.cgi index.pl index.xhtml;
  13.        
  14.  
  15.        
  16.         error_page 400 /error/400.html;
  17.         error_page 401 /error/401.html;
  18.         error_page 403 /error/403.html;
  19.         error_page 404 /error/404.html;
  20.         error_page 405 /error/405.html;
  21.         error_page 500 /error/500.html;
  22.         error_page 502 /error/502.html;
  23.         error_page 503 /error/503.html;
  24.         recursive_error_pages on;
  25.         location = /error/400.html {
  26.             internal;
  27.         }
  28.         location = /error/401.html {
  29.             internal;
  30.         }
  31.         location = /error/403.html {
  32.             internal;
  33.         }
  34.         location = /error/404.html {
  35.             internal;
  36.         }
  37.         location = /error/405.html {
  38.             internal;
  39.         }
  40.         location = /error/500.html {
  41.             internal;
  42.         }
  43.         location = /error/502.html {
  44.             internal;
  45.         }
  46.         location = /error/503.html {
  47.             internal;
  48.         }
  49.        
  50.        
  51.     real_ip_header X-Forwarded-For;
  52.        
  53.         error_log /var/log/ispconfig/httpd/mydomain.com/error.log;
  54.         access_log /var/log/ispconfig/httpd/mydomain.com/access.log combined;
  55.  
  56.         ## Disable .htaccess and other hidden files
  57.         location ~ /\. {
  58.             deny all;
  59.             access_log off;
  60.             log_not_found off;
  61.         }
  62.        
  63.         location = /favicon.ico {
  64.             log_not_found off;
  65.             access_log off;
  66.         }
  67.  
  68.         location = /robots.txt {
  69.             allow all;
  70.             log_not_found off;
  71.             access_log off;
  72.         }
  73.        
  74.         location /stats {
  75.             index index.html index.php;
  76.             auth_basic "Members Only";
  77.             auth_basic_user_file /var/www/clients/client1/web3/.htpasswd_stats;
  78.         }
  79.        
  80.         location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
  81.         access_log off;
  82.         expires max;
  83.         }
  84.  
  85.         location ^~ /awstats-icon {
  86.             alias /usr/share/awstats/icon;
  87.         }
  88.        
  89.         #location ~ \.php$ {
  90.         location ~ / {
  91.         #try_files $uri =404;
  92.         try_files $uri $uri/ /index.php?q=$uri&$args;
  93.                 include /etc/nginx/fastcgi_params;
  94.                 fastcgi_pass unix:/var/lib/php5-fpm/web3.sock;
  95.             fastcgi_index index.php;
  96.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  97.                 #fastcgi_param PATH_INFO $fastcgi_script_name;
  98.                 #fastcgi_intercept_errors on;
  99.         }
  100.        
  101.  
  102.         client_max_body_size 20m;
  103.  
  104.    
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement