]> git.pld-linux.org Git - packages/nginx.git/blob - nginx-perl.conf
add reopen-logs target
[packages/nginx.git] / nginx-perl.conf
1 user                    nginx nginx;
2 error_log               /var/log/nginx/nginx-perl_error.log;
3 pid                     /var/run/nginx-perl.pid;
4
5 events {
6         worker_connections      2048;
7         use epoll;
8 }
9
10 http {
11         include         /etc/nginx/mime.types;
12         default_type    application/octet-stream;
13
14         log_format      main    '$remote_addr - $remote_user [$time_local] $request '
15                                 '"$status" $body_bytes_sent "$http_referer" '
16                                 '"$http_user_agent" "$http_x_forwarded_for"';
17         access_log      /var/log/nginx/nginx-perl_access.log    main;
18
19 #       perl_modules    perl/lib;
20 #       perl_require    /home/services/nginx/cgi-bin/example-hello-01.pm;
21         
22         perl_set  $msie6  '
23         sub {
24                 my $r = shift;
25                 my $ua = $r->header_in("User-Agent");
26                 return "" if $ua =~ /Opera/;
27                 return "1" if $ua =~ / MSIE [6-9]\.\d+/;
28                 return "";
29         }
30         ';
31
32         #       For more visit
33         #       http://wiki.codemongers.com/NginxEmbeddedPerlModule
34
35         server {
36                 listen          80;
37                 server_name     localhost;
38                 access_log      /var/log/nginx/nginx-perl_access.log  main;
39
40                 location / {
41                         #perl   example-hello-01::handler;
42
43                         autoindex       on;
44                         root    /home/services/nginx/html;
45                         index   index.html index.htm index.php;
46                 }
47
48
49                location ~ ^/cgi-bin/.*\.cgi$ {
50                         fastcgi_pass    unix:/var/run/nginx-perl_cgi.sock;
51                         fastcgi_index   index.cgi;
52                         fastcgi_param   SCRIPT_FILENAME /home/services/nginx/$fastcgi_script_name;
53                         fastcgi_param   QUERY_STRING    $query_string;
54                         fastcgi_param   REQUEST_METHOD  $request_method;
55                         fastcgi_param   CONTENT_TYPE    $content_type;
56                         fastcgi_param   CONTENT_LENGTH  $content_length;
57                         fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
58                         fastcgi_param   SERVER_SOFTWARE nginx;
59                         fastcgi_param   SCRIPT_NAME     $fastcgi_script_name;
60                         fastcgi_param   REQUEST_URI     $request_uri;
61                         fastcgi_param   DOCUMENT_URI    $document_uri;
62                         fastcgi_param   DOCUMENT_ROOT   $document_root;
63                         fastcgi_param   SERVER_PROTOCOL $server_protocol;
64                         fastcgi_param   REMOTE_ADDR     $remote_addr;
65                         fastcgi_param   REMOTE_PORT     $remote_port;
66                         fastcgi_param   SERVER_ADDR     $server_addr;
67                         fastcgi_param   SERVER_PORT     $server_port;
68                         fastcgi_param   SERVER_NAME     $server_name;
69                         fastcgi_read_timeout    5m;
70                 }
71
72                 include webapps.d/*.conf;
73         }
74
75         include vhosts.d/*.conf;
76 }
This page took 0.03532 seconds and 3 git commands to generate.