Guest User

nginx conf file

a guest
Mar 18th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. worker_processes                1;
  2.  
  3. events {
  4.   worker_connections            1024;
  5. }
  6.  
  7. http {
  8.   include                       mime.types;
  9.   default_type                  application/octet-stream;
  10.   charset                       utf-8;
  11.   source_charset                utf-8;
  12.   ignore_invalid_headers        on;
  13.   max_ranges                    0;
  14.   recursive_error_pages         on;
  15.   server_tokens                 off;
  16.   sendfile                      on;
  17.   keepalive_timeout             65;
  18.   limit_req_zone                $binary_remote_addr
  19.   zone=gulag:1m                 rate=60r/m;
  20.  
  21.   gzip                          on;
  22.   gzip_vary                     on;
  23.  
  24.  
  25.   root                          /var/www/;
  26.  
  27.   server {
  28.     listen                      80;
  29.     server_name                 mydomain.net *.mydomain.net;
  30.  
  31.     location / {
  32.       index index.html index.htm index.lp index.lua index.php;
  33.     }
  34.  
  35.     location ~* ^.+\.(jpg|jpeg|gif|css|png|js|xml)$ {
  36.       expires           30d;
  37.     }
  38.  
  39.     # Lua
  40.     location ~ ^.+\.(lp|lua)$ {
  41.       add_header              X-Powered-By  Lua/5.1;
  42.       try_files               $uri = 404;
  43.       fastcgi_pass            localhost:9001;
  44.       fastcgi_index           index.lp;
  45.       fastcgi_param           SCRIPT_FILENAME
  46.                               $document_root$fastcgi_script_name;
  47.       include                 fastcgi_params;
  48.     }
  49.  
  50.     # PHP
  51.     location ~ \.php$ {
  52.       try_files             $uri = 404;
  53.       fastcgi_pass          localhost:9000;
  54.       fastcgi_index         index.php;
  55.       fastcgi_param         SCRIPT_FILENAME
  56.                             $document_root$fastcgi_script_name;
  57.       include               fastcgi_params;
  58.     }
  59.  
  60.     location ~ /\.ht {
  61.       deny   all;
  62.     }
  63.  
  64.   } # server:80
  65. } # http
Advertisement
Add Comment
Please, Sign In to add comment