missing files
This commit is contained in:
44
www-servers/nginx/files/nginx-0.6-mod_wsgi.patch
Normal file
44
www-servers/nginx/files/nginx-0.6-mod_wsgi.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
diff -r 8994b058d2db examples/nginx.conf
|
||||
--- a/examples/nginx.conf Wed Mar 26 20:35:15 2008 +0100
|
||||
+++ b/examples/nginx.conf Fri May 02 01:37:33 2008 +0200
|
||||
@@ -14,7 +14,7 @@
|
||||
env PYTHONPATH=/some/path;
|
||||
|
||||
http {
|
||||
- include conf/mime.types;
|
||||
+ include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
#log_format main '$remote_addr - $remote_user [$time_local] $request '
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
gzip off;
|
||||
#ssl on;
|
||||
- #ssl_certificate conf/server.crt;
|
||||
- #ssl_certificate_key conf/server.key;
|
||||
+ #ssl_certificate server.crt;
|
||||
+ #ssl_certificate_key server.key;
|
||||
|
||||
wsgi_python_optimize 0;
|
||||
#wsgi_python_executable /usr/bin/python;
|
||||
@@ -44,7 +44,7 @@
|
||||
server_name localhost;
|
||||
|
||||
|
||||
- include conf/wsgi_vars;
|
||||
+ include wsgi_vars;
|
||||
|
||||
#wsgi_middleware wsgiref.validate validator;
|
||||
#wsgi_middleware paste.lint;
|
||||
diff -r 8994b058d2db src/ngx_http_wsgi_handler.c
|
||||
--- a/src/ngx_http_wsgi_handler.c Wed Mar 26 20:35:15 2008 +0100
|
||||
+++ b/src/ngx_http_wsgi_handler.c Fri May 02 01:37:33 2008 +0200
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
if (r->method == NGX_HTTP_GET || r->method == NGX_HTTP_HEAD) {
|
||||
/* XXX not sure */
|
||||
- rc = ngx_http_discard_body(r);
|
||||
+ rc = ngx_http_discard_request_body(r);
|
||||
|
||||
if (rc != NGX_OK && rc != NGX_AGAIN) {
|
||||
return rc;
|
71
www-servers/nginx/files/nginx-r1
Normal file
71
www-servers/nginx/files/nginx-r1
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2004 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx-r1,v 1.1 2006/07/04 16:58:38 voxus Exp $
|
||||
|
||||
opts="${opts} upgrade reload configtest"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use dns logger
|
||||
}
|
||||
|
||||
start() {
|
||||
configtest || return 1
|
||||
ebegin "Starting nginx"
|
||||
start-stop-daemon --start --pidfile /var/run/nginx.pid \
|
||||
--exec /usr/sbin/nginx -- -c /etc/nginx/nginx.conf
|
||||
eend $? "Failed to start nginx"
|
||||
}
|
||||
|
||||
stop() {
|
||||
configtest || return 1
|
||||
ebegin "Stopping nginx"
|
||||
start-stop-daemon --stop --pidfile /var/run/nginx.pid
|
||||
eend $? "Failed to stop nginx"
|
||||
rm -f /var/run/nginx.pid
|
||||
}
|
||||
|
||||
reload() {
|
||||
configtest || return 1
|
||||
ebegin "Refreshing nginx' configuration"
|
||||
kill -HUP `cat /var/run/nginx.pid` &>/dev/null
|
||||
eend $? "Failed to reload nginx"
|
||||
}
|
||||
|
||||
upgrade() {
|
||||
configtest || return 1
|
||||
ebegin "Upgrading nginx"
|
||||
|
||||
einfo "Sending USR2 to old binary"
|
||||
kill -USR2 `cat /var/run/nginx.pid` &>/dev/null
|
||||
|
||||
einfo "Sleeping 3 seconds before pid-files checking"
|
||||
sleep 3
|
||||
|
||||
if [ ! -f /var/run/nginx.pid.oldbin ]; then
|
||||
eerror "File with old pid not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -f /var/run/nginx.pid ]; then
|
||||
eerror "New binary failed to start"
|
||||
return 1
|
||||
fi
|
||||
|
||||
einfo "Sleeping 3 seconds before WINCH"
|
||||
sleep 3 ; kill -WINCH `cat /var/run/nginx.pid.oldbin`
|
||||
|
||||
einfo "Sending QUIT to old binary"
|
||||
kill -QUIT `cat /var/run/nginx.pid.oldbin`
|
||||
|
||||
einfo "Upgrade completed"
|
||||
|
||||
eend $? "Upgrade failed"
|
||||
}
|
||||
|
||||
configtest() {
|
||||
ebegin "Checking nginx' configuration"
|
||||
/usr/sbin/nginx -c /etc/nginx/nginx.conf -t
|
||||
eend $? "failed, please correct errors above"
|
||||
}
|
72
www-servers/nginx/files/nginx.conf-r4
Normal file
72
www-servers/nginx/files/nginx.conf-r4
Normal file
@@ -0,0 +1,72 @@
|
||||
user nginx nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error_log info;
|
||||
|
||||
events {
|
||||
worker_connections 8192;
|
||||
use epoll;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main
|
||||
'$remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'"$gzip_ratio"';
|
||||
|
||||
client_header_timeout 10m;
|
||||
client_body_timeout 10m;
|
||||
send_timeout 10m;
|
||||
|
||||
connection_pool_size 256;
|
||||
client_header_buffer_size 1k;
|
||||
large_client_header_buffers 4 2k;
|
||||
request_pool_size 4k;
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 1100;
|
||||
gzip_buffers 4 8k;
|
||||
gzip_types text/plain;
|
||||
|
||||
output_buffers 1 32k;
|
||||
postpone_output 1460;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
|
||||
keepalive_timeout 75 20;
|
||||
|
||||
ignore_invalid_headers on;
|
||||
|
||||
index index.html;
|
||||
|
||||
server {
|
||||
listen 127.0.0.1;
|
||||
server_name localhost;
|
||||
|
||||
access_log /var/log/nginx/localhost.access_log main;
|
||||
error_log /var/log/nginx/localhost.error_log info;
|
||||
|
||||
root /var/www/localhost/htdocs;
|
||||
}
|
||||
|
||||
##ssl portion
|
||||
# server {
|
||||
# listen 127.0.0.1:443;
|
||||
# server_name localhost;
|
||||
#
|
||||
# ssl on;
|
||||
# ssl_certificate /etc/ssl/nginx/nginx.pem;
|
||||
# ssl_certificate_key /etc/ssl/nginx/nginx.key;
|
||||
#
|
||||
# access_log /var/log/nginx/localhost.ssl_access_log main;
|
||||
# error_log /var/log/nginx/localhost.ssl_error_log info;
|
||||
#
|
||||
# root /var/www/localhost/htdocs;
|
||||
# }
|
||||
}
|
74
www-servers/nginx/files/use_x_forwarded_host.patch
Normal file
74
www-servers/nginx/files/use_x_forwarded_host.patch
Normal file
@@ -0,0 +1,74 @@
|
||||
diff -r e24850f69497 src/http/ngx_http.c
|
||||
--- a/src/http/ngx_http.c Tue Jan 22 11:49:18 2008 +0100
|
||||
+++ b/src/http/ngx_http.c Sun Feb 10 11:14:22 2008 +0100
|
||||
@@ -363,6 +363,22 @@ ngx_http_block(ngx_conf_t *cf, ngx_comma
|
||||
hk->value = header;
|
||||
}
|
||||
|
||||
+ if (cmcf->use_x_forwarded_host) {
|
||||
+ /* Use the X-Forwarded-Host instead of the Host header */
|
||||
+ ngx_http_header_t *header = ngx_palloc(cf->pool, sizeof(ngx_http_header_t));
|
||||
+
|
||||
+ header->name.data = (u_char *) "X-Forwarded-Host";
|
||||
+ header->name.len = sizeof("X-Forwarded-Host") - 1;
|
||||
+ header->offset = offsetof(ngx_http_headers_in_t, host);
|
||||
+ header->handler = ngx_http_headers_in[0].handler;
|
||||
+
|
||||
+ hk = headers_in.elts;
|
||||
+
|
||||
+ hk->key = header->name;
|
||||
+ hk->key_hash = ngx_hash_key_lc(header->name.data, header->name.len);
|
||||
+ hk->value = header;
|
||||
+ }
|
||||
+
|
||||
hash.hash = &cmcf->headers_in_hash;
|
||||
hash.key = ngx_hash_key_lc;
|
||||
hash.max_size = 512;
|
||||
diff -r e24850f69497 src/http/ngx_http_core_module.c
|
||||
--- a/src/http/ngx_http_core_module.c Tue Jan 22 11:49:18 2008 +0100
|
||||
+++ b/src/http/ngx_http_core_module.c Sun Feb 10 11:14:22 2008 +0100
|
||||
@@ -92,6 +92,13 @@ static ngx_conf_enum_t ngx_http_core_re
|
||||
|
||||
static ngx_command_t ngx_http_core_commands[] = {
|
||||
|
||||
+ { ngx_string("use_x_forwarded_host"),
|
||||
+ NGX_HTTP_MAIN_CONF|NGX_CONF_FLAG,
|
||||
+ ngx_conf_set_flag_slot,
|
||||
+ NGX_HTTP_MAIN_CONF_OFFSET,
|
||||
+ offsetof(ngx_http_core_main_conf_t, use_x_forwarded_host),
|
||||
+ NULL },
|
||||
+
|
||||
{ ngx_string("variables_hash_max_size"),
|
||||
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
||||
ngx_conf_set_num_slot,
|
||||
@@ -2144,6 +2151,8 @@ ngx_http_core_create_main_conf(ngx_conf_
|
||||
return NGX_CONF_ERROR;
|
||||
}
|
||||
|
||||
+ cmcf->use_x_forwarded_host = NGX_CONF_UNSET;
|
||||
+
|
||||
cmcf->server_names_hash_max_size = NGX_CONF_UNSET_UINT;
|
||||
cmcf->server_names_hash_bucket_size = NGX_CONF_UNSET_UINT;
|
||||
|
||||
@@ -2159,6 +2168,10 @@ ngx_http_core_init_main_conf(ngx_conf_t
|
||||
{
|
||||
ngx_http_core_main_conf_t *cmcf = conf;
|
||||
|
||||
+ if (cmcf->use_x_forwarded_host == NGX_CONF_UNSET) {
|
||||
+ cmcf->use_x_forwarded_host = 0;
|
||||
+ }
|
||||
+
|
||||
if (cmcf->server_names_hash_max_size == NGX_CONF_UNSET_UINT) {
|
||||
cmcf->server_names_hash_max_size = 512;
|
||||
}
|
||||
diff -r e24850f69497 src/http/ngx_http_core_module.h
|
||||
--- a/src/http/ngx_http_core_module.h Tue Jan 22 11:49:18 2008 +0100
|
||||
+++ b/src/http/ngx_http_core_module.h Sun Feb 10 11:14:22 2008 +0100
|
||||
@@ -99,6 +99,7 @@ typedef struct {
|
||||
|
||||
ngx_array_t variables; /* ngx_http_variable_t */
|
||||
|
||||
+ ngx_flag_t use_x_forwarded_host;
|
||||
ngx_uint_t server_names_hash_max_size;
|
||||
ngx_uint_t server_names_hash_bucket_size;
|
||||
|
Reference in New Issue
Block a user