Advertisement
Guest User

Untitled

a guest
Apr 28th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.39 KB | None | 0 0
  1. user www-data;
  2. worker_processes 4;
  3. pid /var/run/nginx.pid;
  4.  
  5.  
  6. events {
  7.     worker_connections 768;
  8.     # multi_accept on;
  9. }
  10.  
  11. http {
  12.  
  13.  
  14.     ##
  15.     # Basic Settings
  16.     ##
  17.  
  18.     sendfile on;
  19.     tcp_nopush on;
  20.     tcp_nodelay on;
  21.     keepalive_timeout 65;
  22.     types_hash_max_size 2048;
  23.     # server_tokens off;
  24.  
  25.     # server_names_hash_bucket_size 64;
  26.     # server_name_in_redirect off;
  27.  
  28.     include /etc/nginx/mime.types;
  29.     default_type application/octet-stream;
  30.  
  31.     ##
  32.     # Logging Settings
  33.     ##
  34.  
  35.     #access_log /var/log/nginx/access.log;
  36.     #error_log /var/log/nginx/error.log;
  37.     access_log /home/fx/sites/logs/access.log;
  38.     error_log /home/fx/sites/logs/error.log;
  39.  
  40.     ##
  41.     # Gzip Settings
  42.     ##
  43.  
  44.     gzip on;
  45.     gzip_disable "msie6";
  46.  
  47.     # gzip_vary on;
  48.     # gzip_proxied any;
  49.     # gzip_comp_level 6;
  50.     # gzip_buffers 16 8k;
  51.     # gzip_http_version 1.1;
  52.     # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  53.  
  54.     ##
  55.     # Virtual Host Configs
  56.     ##
  57.  
  58.  
  59.     #include /etc/nginx/conf.d/*.conf;
  60.     include /etc/nginx/sites-enabled/*;
  61.     server {
  62.         # IP, который мы будем слушать
  63.         listen 192.168.1.5:80;        
  64.         charset utf-8;
  65.         index index.html index.php;
  66.         error_page  404  /404.php;
  67.  
  68.         server_name xxe.ru *.xxe.ru;
  69.         root /home/fx/sites/$subdomain.xxe;
  70.         set $subdomain "default";
  71.         if ($host ~* ^([a-z0-9-\.]+)\.xxe.ru$) {
  72.             set $subdomain $1;
  73.         }
  74.         if ($host ~* ^www.xxe.ru$) {
  75.              set $subdomain "default";
  76.         }        
  77.         #location ~ ([0-9]+)\.begin$  {
  78.             # IP и порт, на которых висит node.js
  79.         #    proxy_pass http://192.168.1.5:$1;
  80.         #    proxy_set_header Host $host;
  81.         #}
  82.        
  83.         location ~ \.(php|begin)$ {
  84.             fastcgi_pass   127.0.0.1:9000;
  85.             #fastcgi_pass unix:/var/run/php5-fpm.sock;
  86.             fastcgi_index  index.php;
  87.             fastcgi_param  SCRIPT_FILENAME  /home/fx/sites/$subdomain.xxe$fastcgi_script_name;
  88.             fastcgi_read_timeout 360000;                
  89.             include        fastcgi_params;
  90.         }
  91.    
  92.         location / {
  93.             if ($subdomain = auto){
  94.                 rewrite ^/api/(.*)$ /parser.php$1;
  95.                 rewrite "^/([0-9]{1,10})$" /?id=$1;
  96.                 rewrite "^/search/([0-9]{1,10})$" /?searchId=$1;
  97.                 rewrite "^/archive/([0-9]{1,10})(\-.*)?" /parser.php?q=archive&archiveId=$1;
  98.             }
  99.         }
  100.  
  101.  
  102.     }
  103. # include /etc/nginx/sites-enabled/*;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement