From e13af587310c7176b278e3692d33a2d42b075754 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sep 17 2014 15:50:18 +0000 Subject: test build for #1142298 - drop all servers from nginx.conf - define default server in conf.d/default.conf - add global.d directory - use fastcgi_param SERVER_NAME $host --- diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..2ab310e --- /dev/null +++ b/default.conf @@ -0,0 +1,27 @@ +server { + listen 80 default_server; + server_name localhost; + root /usr/share/nginx/html; + + #charset koi8-r; + + #access_log /var/log/nginx/host.access.log main; + + # Global configuration for all servers + include global.d/*.conf; + + location / { + } + + # redirect server error pages to the static page /40x.html + # + error_page 404 /404.html; + location = /40x.html { + } + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + } +} diff --git a/nginx.conf b/nginx.conf index b2bbf14..b926731 100644 --- a/nginx.conf +++ b/nginx.conf @@ -35,94 +35,10 @@ http { #gzip on; + index index.html index.htm; + # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; - - index index.html index.htm; - - server { - listen 80; - server_name localhost; - root /usr/share/nginx/html; - - #charset koi8-r; - - #access_log /var/log/nginx/host.access.log main; - - location / { - } - - # redirect server error pages to the static page /40x.html - # - error_page 404 /404.html; - location = /40x.html { - } - - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.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; - #} - } - - - # another virtual host using mix of IP-, name-, and port-based configuration - # - #server { - # listen 8000; - # listen somename:8080; - # server_name somename alias another.alias; - # root html; - - # location / { - # } - #} - - - # HTTPS server - # - #server { - # listen 443; - # server_name localhost; - # root html; - - # ssl on; - # ssl_certificate cert.pem; - # ssl_certificate_key cert.key; - - # ssl_session_timeout 5m; - - # ssl_protocols SSLv2 SSLv3 TLSv1; - # ssl_ciphers HIGH:!aNULL:!MD5; - # ssl_prefer_server_ciphers on; - - # location / { - # } - #} - } diff --git a/nginx.spec b/nginx.spec index 74a73d8..53dd0dd 100644 --- a/nginx.spec +++ b/nginx.spec @@ -27,7 +27,7 @@ Name: nginx Epoch: 1 Version: 1.6.2 -Release: 1%{?dist} +Release: 1%{?dist}.1 Summary: A high performance web server and reverse proxy server Group: System Environment/Daemons @@ -45,6 +45,7 @@ Source13: nginx-upgrade Source14: nginx-upgrade.8 Source15: nginx.init Source16: nginx.sysconfig +Source17: default.conf Source100: index.html Source101: poweredby.png Source102: nginx-logo.png @@ -178,6 +179,7 @@ install -p -D -m 0644 %{SOURCE11} \ %{buildroot}%{_sysconfdir}/logrotate.d/nginx install -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d +install -p -d -m 0755 %{buildroot}%{nginx_confdir}/global.d install -p -d -m 0700 %{buildroot}%{nginx_home} install -p -d -m 0700 %{buildroot}%{nginx_home_tmp} install -p -d -m 0700 %{buildroot}%{nginx_logdir} @@ -185,6 +187,8 @@ install -p -d -m 0755 %{buildroot}%{nginx_webroot} install -p -m 0644 %{SOURCE12} \ %{buildroot}%{nginx_confdir} +install -p -m 0644 %{SOURCE17} \ + %{buildroot}%{nginx_confdir}/conf.d/ install -p -m 0644 %{SOURCE100} \ %{buildroot}%{nginx_webroot} install -p -m 0644 %{SOURCE101} %{SOURCE102} \ @@ -198,6 +202,10 @@ install -p -D -m 0644 %{_builddir}/nginx-%{version}/man/nginx.8 \ install -p -D -m 0755 %{SOURCE13} %{buildroot}%{_bindir}/nginx-upgrade install -p -D -m 0644 %{SOURCE14} %{buildroot}%{_mandir}/man8/nginx-upgrade.8 +# I think this is better configuratio, more close to apache behavior +sed -e '/SERVER_NAME/s/server_name/host/' \ + -i %{buildroot}%{nginx_confdir}/fastcgi_params + %pre getent group %{nginx_group} > /dev/null || groupadd -r %{nginx_group} @@ -256,6 +264,7 @@ fi %endif %dir %{nginx_confdir} %dir %{nginx_confdir}/conf.d +%dir %{nginx_confdir}/global.d %config(noreplace) %{nginx_confdir}/fastcgi.conf %config(noreplace) %{nginx_confdir}/fastcgi.conf.default %config(noreplace) %{nginx_confdir}/fastcgi_params @@ -271,6 +280,7 @@ fi %config(noreplace) %{nginx_confdir}/uwsgi_params %config(noreplace) %{nginx_confdir}/uwsgi_params.default %config(noreplace) %{nginx_confdir}/win-utf +%config(noreplace) %{nginx_confdir}/conf.d/default.conf %config(noreplace) %{_sysconfdir}/logrotate.d/nginx %dir %{perl_vendorarch}/auto/nginx %{perl_vendorarch}/nginx.pm @@ -281,6 +291,13 @@ fi %changelog +* Wed Sep 17 2014 Remi Collet - 1:1.6.2-1.1 +- test build for #1142298 +- drop all servers from nginx.conf +- define default server in conf.d/default.conf +- add global.d directory +- use fastcgi_param SERVER_NAME $host + * Wed Sep 17 2014 Jamie Nguyen - 1:1.6.2-1 - update to upstream release 1.6.2 - CVE-2014-3616 nginx: virtual host confusion (#1142573)