#user nobody; #worker_processes 1; worker_processes 2; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; worker_rlimit_nofile 65535; events { use epoll; worker_connections 65535; } http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 8m; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; tcp_nopush on; keepalive_timeout 0; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; # 此处开始配置 perl_modules /opt/npweb; #框架的目录 perl_require Action.pm; #框架的入口 server{ # 此处配置框架的设置 set $CONTEXT_PATH '/perl'; # uri的访问路径,如:http:// test.perl.nginx /perl set $APPLICATION_PATH '/opt/npweb_app/'; # web服务的路径,在该路径下需要放置一个lib目录,以放置一些自自定模块。 listen 80; server_name test.perl.nginx; location /perl { # 此处需与$CONTEXT_PATH保持一致 perl Action::execute; # 此处如此配置,不用更改 } } } |