Package: nginx
Version: 0.7.67-4
Severity: wishlist

I'm writing abou the possibility of adding a shell script I wrote to
the nginx package in order to disable or enable a particular site. The
script is modeled after the apache2-common a2ensite perl script. It is
written in Bash rather than in Perl.

I'm aware that this adds bash as a dependency. But I find that the
easy site enabling/disabling to be a net gain over the requirement of
Bash.

This is just an idea. The script is attached to this message.

Thank you,
António
--- appa



-- System Information:
Debian Release: squeeze/sid
 APT prefers testing
 APT policy: (700, 'testing'), (650, 'unstable'), (500, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.34-ck1maxwell (PREEMPT)
Locale: LANG=pt_PT.UTF-8, LC_CTYPE=pt_PT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages nginx depends on:
ii  libc6                 2.11.2-2           Embedded GNU C Library: Shared lib
ii  libgeoip1             1.4.7~beta6+dfsg-1 A non-DNS IP-to-country resolver l
ii  libpcre3              8.02-1.1           Perl 5 Compatible Regular Expressi
ii  libssl0.9.8           0.9.8o-1           SSL shared libraries
ii  lsb-base              3.2-23.1           Linux Standard Base 3.2 init scrip
ii  zlib1g                1:1.2.3.4.dfsg-3   compression library - runtime

nginx recommends no packages.

nginx suggests no packages.

-- Configuration Files:
/etc/nginx/fastcgi_params changed:
fastcgi_read_timeout 14400; # allow 4 hrs - pass timeo responsibility to 
upstream
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;
fastcgi_param  REDIRECT_STATUS    200;

/etc/nginx/nginx.conf changed:
user www-data;
worker_processes  1;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;
worker_rlimit_nofile 8192;
events {
   worker_connections  2048;
# epoll is preferred on 2.6 Linux kernels. Cf. http://www.kegel.com/c10k.html#nb.epoll use epoll;
   # Accept as many connections as possible.
   multi_accept on;
   }
http {
   # MIME types.
   include     /etc/nginx/mime.types;
   include     /etc/nginx/fastcgi.conf;
   default_type  application/octet-stream;
   # Log file.
   access_log   /var/log/nginx/access.log;
   # Use X-Accel-Redirect header. This hides static files path from
   # the client. It doesn't modify other HTTP headers.
   sendfile        on;
   # Handling of IPs in proxied and load balancing situations.
   set_real_ip_from        0.0.0.0/32; # all addresses get a real IP.
   real_ip_header     X-Forwarded-For; # the ip is forwarded from the load 
balancer/proxy
   # Define a zone for limiting the number of simultaneous
   # connections nginx accepts. 1m means 3200 simultaneous
   # sessions. We need to define for each server the limit_conn value
   # referring tho this or other zones.
   limit_zone arbeit $binary_remote_addr 1m;
   # Timeouts.
client_body_timeout 60; client_header_timeout 60;
   keepalive_timeout            75 20;
   send_timeout                    60;
   # TCP options.
   tcp_nodelay        on;
   tcp_nopush         on;
   ## Compression.
   gzip              on;
   gzip_buffers      16 8k;
   gzip_comp_level   1;
   gzip_http_version 1.1;
   gzip_min_length   10;
   gzip_types        text/plain text/css image/png image/gif image/jpeg 
application/x-javascript text/xml application/xml application/xml+rss 
text/javascript image/x-icon;
   gzip_vary         on;
   gzip_proxied      any; # Compression for all requests.
   # No need for regexps. See 
http://wiki.nginx.org/NginxHttpGzipModule#gzip_disable
   gzip_disable "msie6";
   # For the filefield_nginx_progress module to work. From the
   # README. Reserve 1MB under the name 'uploads' to track uploads.
   upload_progress uploads 1m;
   # Enable clickjacking protection in modern browsers. Available in
   # IE8 also.
   add_header X-Frame-Options sameorigin;
   # Include all other conf files.
# Include all vhosts. include /etc/nginx/sites-enabled/*;
}

/etc/nginx/sites-available/default changed:
server {
        listen   80 default;
       server_name _;
        access_log  /var/log/nginx/access.log;
       # Include the blacklist.conf file.
       include sites-available/blacklist.conf;
       # Disable all methods besides HEAD, GET and POST.
       if ($request_method !~ ^(GET|HEAD|POST)$ ) {
           return 444;
       }
       # Deny illegal Host headers
       # if ($host !~* ^(perusio|www.perusio)$ ) {
       #    return 444;
       # }
       # Redirect all www.perusio.net requests to perusio.net.
if ($host ~* ^www\.(.+)) { set $domain_only $1;
          rewrite ^/(.*)$  http://$domain_only/$1 permanent;
       }
       root   /var/www/sites/;
       index index.html index.htm;
       allow 127.0.0.1;
       allow 192.168.1.0/24;
       deny all;
       # Include all Drupal stuff.
        #error_page  404  /404.html;
        # redirect server error pages to the static page /50x.html
        #
        #error_page   500 502 503 504  /50x.html;
        #location = /50x.html {
        #       root   /var/www/nginx-default;
        #}
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
                #proxy_pass   http://127.0.0.1;
        #}
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
                #fastcgi_pass   127.0.0.1:9000;
                #fastcgi_index  index.php;
                #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
                #includefastcgi_params;
        #}
        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
                #deny  all;
        #}
}


-- no debconf information

Attachment: nginx_ensite.tar.gz
Description: Binary data

Reply via email to