3 error_log /var/log/nginx/nginx-perl_error.log;
4 pid /var/run/nginx-perl.pid;
7 worker_connections 2048;
12 include /etc/nginx/mime.types;
13 default_type application/octet-stream;
15 log_format main '$remote_addr - $remote_user [$time_local] $request '
16 '"$status" $body_bytes_sent "$http_referer" '
17 '"$http_user_agent" "$http_x_forwarded_for"';
18 access_log /var/log/nginx/nginx-perl_access.log main;
22 server_names_hash_bucket_size 128;
23 types_hash_max_size 2048;
24 types_hash_bucket_size 64;
27 limit_zone test-limit $binary_remote_addr 10m;
30 # perl_modules perl/lib;
31 # perl_require /home/services/nginx/cgi-bin/example-hello-01.pm;
36 my $ua = $r->header_in("User-Agent");
37 return "" if $ua =~ /Opera/;
38 return "1" if $ua =~ / MSIE [6-9]\.\d+/;
44 # http://wiki.codemongers.com/NginxEmbeddedPerlModule
48 server_name localhost;
49 access_log /var/log/nginx/nginx-perl_access.log main;
50 client_max_body_size 10M;
53 perl example-hello-01::handler;
54 limit_conn test-limit 15;
58 location ~ ^/cgi-bin/.*\.cgi$ {
59 fastcgi_pass unix:/var/run/nginx-perl_cgi.sock;
60 fastcgi_index index.cgi;
61 fastcgi_param SCRIPT_FILENAME /home/services/nginx/$fastcgi_script_name;
62 fastcgi_param QUERY_STRING $query_string;
63 fastcgi_param REQUEST_METHOD $request_method;
64 fastcgi_param CONTENT_TYPE $content_type;
65 fastcgi_param CONTENT_LENGTH $content_length;
66 fastcgi_param GATEWAY_INTERFACE CGI/1.1;
67 fastcgi_param SERVER_SOFTWARE nginx;
68 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
69 fastcgi_param REQUEST_URI $request_uri;
70 fastcgi_param DOCUMENT_URI $document_uri;
71 fastcgi_param DOCUMENT_ROOT $document_root;
72 fastcgi_param SERVER_PROTOCOL $server_protocol;
73 fastcgi_param REMOTE_ADDR $remote_addr;
74 fastcgi_param REMOTE_PORT $remote_port;
75 fastcgi_param SERVER_ADDR $server_addr;
76 fastcgi_param SERVER_PORT $server_port;
77 fastcgi_param SERVER_NAME $server_name;
78 fastcgi_read_timeout 5m;
81 # location /nginx_status {
88 # error_page 404 /404.html;
89 # error_page 500 502 503 504 /50x.html;
90 # location = /50x.html {
91 # root /home/services/http/error-pages;
93 # location = /404.html {
94 # root /home/services/http/error-pages;