Update to new upstream stable branch

update to 0.6 upstream stable branch
add default index.html and error pages
This commit is contained in:
jjh 2008-05-12 04:40:35 +00:00
parent 418cb6503b
commit 4354b0d3eb
11 changed files with 591 additions and 52 deletions

119
404.html Normal file
View File

@ -0,0 +1,119 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>The page is not found</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background-color: #fff;
color: #000;
font-size: 0.9em;
font-family: sans-serif,helvetica;
margin: 0;
padding: 0;
}
:link {
color: #c00;
}
:visited {
color: #c00;
}
a:hover {
color: #f50;
}
h1 {
text-align: center;
margin: 0;
padding: 0.6em 2em 0.4em;
background-color: #294172;
color: #fff;
font-weight: normal;
font-size: 1.75em;
border-bottom: 2px solid #000;
}
h1 strong {
font-weight: bold;
font-size: 1.5em;
}
h2 {
text-align: center;
background-color: #3C6EB4;
font-size: 1.1em;
font-weight: bold;
color: #fff;
margin: 0;
padding: 0.5em;
border-bottom: 2px solid #294172;
}
h3 {
text-align: center;
background-color: #ff0000;
padding: 0.5em;
color: #fff;
}
hr {
display: none;
}
.content {
padding: 1em 5em;
}
.alert {
border: 2px solid #000;
}
img {
border: 2px solid #fff;
padding: 2px;
margin: 2px;
}
a:hover img {
border: 2px solid #294172;
}
.logos {
margin: 1em;
text-align: center;
}
/*]]>*/
</style>
</head>
<body>
<h1><strong>nginx error!</strong></h1>
<div class="content">
<h3>The page you are looking for is not found.</h3>
<div class="alert">
<h2>Website Administrator</h2>
<div class="content">
<p>Something has triggered missing webpage on your
website. This is the default 404 error page for
<strong>nginx</strong> that is distributed with
Fedora. It is located
<tt>/usr/share/nginx/html/404.html</tt></p>
<p>You should customize this error page for your own
site or edit the <tt>error_page</tt> directive in
the <strong>nginx</strong> configuration file
<tt>/etc/nginx/nginx.conf</tt>.</p>
</div>
</div>
<div class="logos">
<a href="http://nginx.net/"><img
src="nginx-logo.png"
alt="[ Powered by nginx ]"
width="121" height="32" /></a>
<a href="http://fedoraproject.org/"><img
src="poweredby.png"
alt="[ Powered by Fedora ]"
width="88" height="31" /></a>
</div>
</div>
</body>
</html>

119
50x.html Normal file
View File

@ -0,0 +1,119 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>The page is temporarily unavailable</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background-color: #fff;
color: #000;
font-size: 0.9em;
font-family: sans-serif,helvetica;
margin: 0;
padding: 0;
}
:link {
color: #c00;
}
:visited {
color: #c00;
}
a:hover {
color: #f50;
}
h1 {
text-align: center;
margin: 0;
padding: 0.6em 2em 0.4em;
background-color: #294172;
color: #fff;
font-weight: normal;
font-size: 1.75em;
border-bottom: 2px solid #000;
}
h1 strong {
font-weight: bold;
font-size: 1.5em;
}
h2 {
text-align: center;
background-color: #3C6EB4;
font-size: 1.1em;
font-weight: bold;
color: #fff;
margin: 0;
padding: 0.5em;
border-bottom: 2px solid #294172;
}
h3 {
text-align: center;
background-color: #ff0000;
padding: 0.5em;
color: #fff;
}
hr {
display: none;
}
.content {
padding: 1em 5em;
}
.alert {
border: 2px solid #000;
}
img {
border: 2px solid #fff;
padding: 2px;
margin: 2px;
}
a:hover img {
border: 2px solid #294172;
}
.logos {
margin: 1em;
text-align: center;
}
/*]]>*/
</style>
</head>
<body>
<h1><strong>nginx error!</strong></h1>
<div class="content">
<h3>The page you are looking for is temporarily unavailable. Please try again later.</h3>
<div class="alert">
<h2>Website Administrator</h2>
<div class="content">
<p>Something has triggered an error on your
website. This is the default error page for
<strong>nginx</strong> that is distributed with
Fedora. It is located
<tt>/usr/share/nginx/html/50x.html</tt></p>
<p>You should customize this error page for your own
site or edit the <tt>error_page</tt> directive in
the <strong>nginx</strong> configuration file
<tt>/etc/nginx/nginx.conf</tt>.</p>
</div>
</div>
<div class="logos">
<a href="http://nginx.net/"><img
src="nginx-logo.png"
alt="[ Powered by nginx ]"
width="121" height="32" /></a>
<a href="http://fedoraproject.org/"><img
src="poweredby.png"
alt="[ Powered by Fedora ]"
width="88" height="31" /></a>
</div>
</div>
</body>
</html>

116
index.html Normal file
View File

@ -0,0 +1,116 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Test Page for the Nginx HTTP Server on Fedora</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background-color: #fff;
color: #000;
font-size: 0.9em;
font-family: sans-serif,helvetica;
margin: 0;
padding: 0;
}
:link {
color: #c00;
}
:visited {
color: #c00;
}
a:hover {
color: #f50;
}
h1 {
text-align: center;
margin: 0;
padding: 0.6em 2em 0.4em;
background-color: #294172;
color: #fff;
font-weight: normal;
font-size: 1.75em;
border-bottom: 2px solid #000;
}
h1 strong {
font-weight: bold;
font-size: 1.5em;
}
h2 {
text-align: center;
background-color: #3C6EB4;
font-size: 1.1em;
font-weight: bold;
color: #fff;
margin: 0;
padding: 0.5em;
border-bottom: 2px solid #294172;
}
hr {
display: none;
}
.content {
padding: 1em 5em;
}
.alert {
border: 2px solid #000;
}
img {
border: 2px solid #fff;
padding: 2px;
margin: 2px;
}
a:hover img {
border: 2px solid #294172;
}
.logos {
margin: 1em;
text-align: center;
}
/*]]>*/
</style>
</head>
<body>
<h1>Welcome to <strong>nginx</strong> on Fedora!</h1>
<div class="content">
<p>This page is used to test the proper operation of the
<strong>nginx</strong> HTTP server after it has been
installed. If you can read this page, it means that the
web server installed at this site is working
properly.</p>
<div class="alert">
<h2>Website Administrator</h2>
<div class="content">
<p>This is the default <tt>index.html</tt> page that
is distributed with <strong>nginx</strong> on
Fedora. It is located in
<tt>/usr/share/nginx/html</tt>.</p>
<p>You should now put your content in a location of
your choice and edit the <tt>root</tt> configuration
directive in the <strong>nginx</strong>
configuration file
<tt>/etc/nginx/nginx.conf</tt>.</p>
</div>
</div>
<div class="logos">
<a href="http://nginx.net/"><img
src="nginx-logo.png"
alt="[ Powered by nginx ]"
width="121" height="32" /></a>
<a href="http://fedoraproject.org/"><img
src="poweredby.png"
alt="[ Powered by Fedora ]"
width="88" height="31" /></a>
</div>
</div>
</body>
</html>

View File

@ -1,6 +1,6 @@
--- auto/install.orig 2007-03-22 09:30:15.000000000 -0600
+++ auto/install 2007-03-22 09:40:42.000000000 -0600
@@ -19,42 +19,42 @@
--- auto/install.orig 2008-05-11 15:02:01.000000000 -0600
+++ auto/install 2008-05-11 15:03:54.000000000 -0600
@@ -19,45 +19,45 @@
install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
$NGX_INSTALL_PERL_MODULES
@ -16,29 +16,34 @@
+ test ! -f '$NGX_DEST_DIR$NGX_SBIN_PATH' || mv '$NGX_DEST_DIR$NGX_SBIN_PATH' '$NGX_DEST_DIR$NGX_SBIN_PATH.old'
+ cp $NGX_OBJS/nginx '$NGX_DEST_DIR$NGX_SBIN_PATH'
- test -d '`dirname "$NGX_CONF_PATH"`' \
- || mkdir -p '`dirname "$NGX_CONF_PATH"`'
+ test -d '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`' \
+ || mkdir -p '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`'
- test -d '$NGX_CONF_PREFIX' || mkdir -p '$NGX_CONF_PREFIX'
+ test -d '$NGX_DEST_DIR$NGX_CONF_PREFIX' || mkdir -p '$NGX_DEST_DIR$NGX_CONF_PREFIX'
- cp conf/koi-win '`dirname "$NGX_CONF_PATH"`'
- cp conf/koi-utf '`dirname "$NGX_CONF_PATH"`'
- cp conf/win-utf '`dirname "$NGX_CONF_PATH"`'
+ cp conf/koi-win '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`'
+ cp conf/koi-utf '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`'
+ cp conf/win-utf '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`'
- cp conf/koi-win '$NGX_CONF_PREFIX'
- cp conf/koi-utf '$NGX_CONF_PREFIX'
- cp conf/win-utf '$NGX_CONF_PREFIX'
+ cp conf/koi-win '$NGX_DEST_DIR$NGX_CONF_PREFIX'
+ cp conf/koi-utf '$NGX_DEST_DIR$NGX_CONF_PREFIX'
+ cp conf/win-utf '$NGX_DEST_DIR$NGX_CONF_PREFIX'
- test -f '`dirname "$NGX_CONF_PATH"`/mime.types' || \
- cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types'
- cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types.default'
+ test -f '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/mime.types' || \
+ cp conf/mime.types '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/mime.types'
+ cp conf/mime.types '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/mime.types.default'
- test -f '$NGX_CONF_PREFIX/mime.types' \
- || cp conf/mime.types '$NGX_CONF_PREFIX'
- cp conf/mime.types '$NGX_CONF_PREFIX/mime.types.default'
+ test -f '$NGX_DEST_DIR$NGX_CONF_PREFIX/mime.types' \
+ || cp conf/mime.types '$NGX_DEST_DIR$NGX_CONF_PREFIX'
+ cp conf/mime.types '$NGX_DEST_DIR$NGX_CONF_PREFIX/mime.types.default'
- test -f '$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_CONF_PATH'
- cp conf/nginx.conf '`dirname "$NGX_CONF_PATH"`/nginx.conf.default'
+ test -f '$NGX_DEST_DIR$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_DEST_DIR$NGX_CONF_PATH'
+ cp conf/nginx.conf '`dirname "$NGX_DEST_DIR$NGX_CONF_PATH"`/nginx.conf.default'
- test -f '$NGX_CONF_PREFIX/fastcgi_params' \
- || cp conf/fastcgi_params '$NGX_CONF_PREFIX'
- cp conf/fastcgi_params '$NGX_CONF_PREFIX/fastcgi_params.default'
+ test -f '$NGX_DEST_DIR$NGX_CONF_PREFIX/fastcgi_params' \
+ || cp conf/fastcgi_params '$NGX_DEST_DIR$NGX_CONF_PREFIX'
+ cp conf/fastcgi_params '$NGX_DEST_DIR$NGX_CONF_PREFIX/fastcgi_params.default'
- test -f '$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_CONF_PREFIX'
- cp conf/nginx.conf '$NGX_CONF_PREFIX/nginx.conf.default'
+ test -f '$NGX_DEST_DIR$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_DEST_DIR$NGX_CONF_PREFIX'
+ cp conf/nginx.conf '$NGX_DEST_DIR$NGX_CONF_PREFIX/nginx.conf.default'
- test -d '`dirname "$NGX_PID_PATH"`' \
- || mkdir -p '`dirname "$NGX_PID_PATH"`'
@ -56,13 +61,13 @@
-if test -n "$NGX_ERROR_LOG_PATH"; then
+if test -n "$NGX_DEST_DIR/$NGX_ERROR_LOG_PATH"; then
+if test -n "$NGX_DEST_DIR$NGX_ERROR_LOG_PATH"; then
cat << END >> $NGX_MAKEFILE
- test -d '`dirname "$NGX_ERROR_LOG_PATH"`' || \
- mkdir -p '`dirname "$NGX_ERROR_LOG_PATH"`'
+ test -d '`dirname "$NGX_DEST_DIR/$NGX_ERROR_LOG_PATH"`' || \
+ mkdir -p '`dirname "$NGX_DEST_DIR/$NGX_ERROR_LOG_PATH"`'
+ test -d '`dirname "$NGX_DEST_DIR$NGX_ERROR_LOG_PATH"`' || \
+ mkdir -p '`dirname "$NGX_DEST_DIR$NGX_ERROR_LOG_PATH"`'
END
fi

View File

@ -1,7 +1,23 @@
--- conf/nginx.conf.orig 2007-03-22 22:44:23.000000000 -0600
+++ conf/nginx.conf 2007-03-22 23:06:48.000000000 -0600
@@ -1,12 +1,11 @@
-
--- conf/nginx.conf.orig 2008-05-11 21:19:44.000000000 -0600
+++ conf/nginx.conf 2008-05-11 22:20:32.000000000 -0600
@@ -1,28 +1,59 @@
+#######################################################################
+#
+# This is the main Nginx configuration file.
+#
+# More information about the configuration options is available on
+# * the English wiki - http://wiki.codemongers.com/Main
+# * the Russian documentation - http://sysoev.ru/nginx/
+#
+#######################################################################
+
+#----------------------------------------------------------------------
+# Main Module - directives that cover basic functionality
+#
+# http://wiki.codemongers.com/NginxMainModule
+#
+#----------------------------------------------------------------------
-#user nobody;
+user nginx;
worker_processes 1;
@ -17,12 +33,28 @@
+pid /var/run/nginx.pid;
+
+#----------------------------------------------------------------------
+# Events Module
+#
+# http://wiki.codemongers.com/NginxEventsModule
+#
+#----------------------------------------------------------------------
+
events {
@@ -15,14 +14,14 @@
worker_connections 1024;
}
+#----------------------------------------------------------------------
+# HTTP Core Module
+#
+# http://wiki.codemongers.com/NginxHttpCoreModule
+#
+#----------------------------------------------------------------------
+
http {
- include conf/mime.types;
- include mime.types;
+ include /etc/nginx/mime.types;
default_type application/octet-stream;
@ -38,18 +70,88 @@
sendfile on;
#tcp_nopush on;
@@ -38,7 +37,7 @@
@@ -31,27 +62,36 @@
keepalive_timeout 65;
#gzip on;
+
+ # Load config files from the /etc/nginx/conf.d directory
+ include /etc/nginx/conf.d/*.conf;
+ #
+ # The default server
+ #
server {
- listen 80;
- server_name localhost;
+ listen 80 default;
+ server_name _;
#charset koi8-r;
- #access_log logs/host.access.log main;
+ #access_log /var/log/nginx/host.access.log main;
#access_log logs/host.access.log main;
location / {
root html;
@@ -113,5 +112,4 @@
# index index.html index.htm;
# }
- root html;
+ root /usr/share/nginx/html;
index index.html index.htm;
}
- #error_page 404 /404.html;
+ error_page 404 /404.html;
+ location = /404.html {
+ root /usr/share/nginx/html;
+ }
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
- root html;
+ root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
@@ -77,42 +117,4 @@
# deny all;
#}
}
-
-
- # another virtual host using mix of IP-, name-, and port-based configuration
- #
- #server {
- # listen 8000;
- # listen somename:8080;
- # server_name somename alias another.alias;
-
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
-
-
- # HTTPS server
- #
- #server {
- # listen 443;
- # server_name localhost;
-
- # ssl on;
- # ssl_certificate cert.pem;
- # ssl_certificate_key cert.key;
-
- # ssl_session_timeout 5m;
-
- # ssl_protocols SSLv2 SSLv3 TLSv1;
- # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
- # ssl_prefer_server_ciphers on;
-
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
-
}

BIN
nginx-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

View File

@ -7,6 +7,7 @@
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid
# Source function library.
@ -21,13 +22,17 @@
nginx="/usr/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/etc/nginx/nginx.conf"
[ -e /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
start() {
[ -x $nginx ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
daemon $nginx -c /etc/$prog/$prog.conf
daemon $nginx -c $config
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
@ -59,24 +64,40 @@ force_reload() {
restart
}
fdr_status() {
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start|stop|restart|reload)
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
fdr_status
rh_status
;;
condrestart|try-restart)
[ ! -f $lockfile ] || restart
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac

BIN
poweredby.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

24
ssl.conf Normal file
View File

@ -0,0 +1,24 @@
#
# HTTPS server configuration
#
#server {
# listen 443;
# server_name _;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}

18
upstream-fair.conf Normal file
View File

@ -0,0 +1,18 @@
#
# This is a sample configuration to use the nginx-upstream-fair module
# that is included.
#
# http://wiki.codemongers.com/NginxHttpUpstreamFairModule
#
# Change your Nginx config file's upstream block to include the 'fair'
# directive:
#
# upstream mongrel {
# fair;
# server 127.0.0.1:5000;
# server 127.0.0.1:5001;
# server 127.0.0.1:5002;
# }

15
virtual.conf Normal file
View File

@ -0,0 +1,15 @@
#
# A virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}