From df455918533bd1011dacaef6dbfad7ae8505dc47 Mon Sep 17 00:00:00 2001 From: Jeremy Hinegardner Date: Sun, 12 Dec 2010 23:12:10 -0700 Subject: [PATCH] Extract default server into its own config file. Bug #635776 --- default.conf | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ nginx.conf | 53 +--------------------------------------------------- nginx.spec | 8 ++++++-- 3 files changed, 60 insertions(+), 54 deletions(-) create mode 100644 default.conf diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..33cd547 --- /dev/null +++ b/default.conf @@ -0,0 +1,53 @@ +# +# The default server +# +server { + listen 80; + server_name _; + + #charset koi8-r; + + #access_log logs/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + 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 /usr/share/nginx/html; + } + + # 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$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} + + diff --git a/nginx.conf b/nginx.conf index f3dc403..dc8091c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -62,59 +62,8 @@ http { #gzip on; - # - # The default server - # - server { - listen 80; - server_name _; - - #charset koi8-r; - - #access_log logs/host.access.log main; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - } - - 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 /usr/share/nginx/html; - } - - # 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$ { - # root html; - # fastcgi_pass 127.0.0.1:9000; - # fastcgi_index index.php; - # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; - # include fastcgi_params; - #} - - # deny access to .htaccess files, if Apache's document root - # concurs with nginx's one - # - #location ~ /\.ht { - # deny all; - #} - } - # Load config files from the /etc/nginx/conf.d directory + # The default server is in conf.d/default.conf include /etc/nginx/conf.d/*.conf; } diff --git a/nginx.spec b/nginx.spec index 4217ed9..9c269c1 100644 --- a/nginx.spec +++ b/nginx.spec @@ -9,7 +9,7 @@ Name: nginx Version: 0.8.53 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Robust, small and high performance HTTP and reverse proxy server Group: System Environment/Daemons @@ -38,6 +38,7 @@ Source3: virtual.conf Source4: ssl.conf Source5: %{name}.sysconfig Source6: nginx.conf +Source7: default.conf Source100: index.html Source101: poweredby.png Source102: nginx-logo.png @@ -115,7 +116,7 @@ chmod 0755 %{buildroot}%{_sbindir}/nginx %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %{__install} -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d -%{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{buildroot}%{nginx_confdir}/conf.d +%{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE7} %{buildroot}%{nginx_confdir}/conf.d %{__install} -p -m 0644 %{SOURCE6} %{buildroot}%{nginx_confdir} %{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp} %{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir} @@ -190,6 +191,9 @@ fi %changelog +* Sun Dec 12 2010 Jeremy Hinegardner - 0.8.53.5 +- Extract out default config into its own file (bug #635776) + * Sun Dec 12 2010 Jeremy Hinegardner - 0.8.53-4 - Revert ownership of log dir