From 5d5f34518d8b3d73c7acdace10da17cff6cc1114 Mon Sep 17 00:00:00 2001 From: Alfredo Ramos Date: Thu, 9 Jan 2020 19:10:25 -0600 Subject: [ticket/16313] Remove http block from sample Nginx configuration file Change placeholder domain to example.com Also prefer fastcgi.conf over fastcgi_params as per Nginx documentation. PHPBB3-16313 --- phpBB/docs/nginx.sample.conf | 206 +++++++++++++++++++------------------------ travis/setup-webserver.sh | 23 +++-- 2 files changed, 107 insertions(+), 122 deletions(-) diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf index c5a9472a1c..25363ad34d 100644 --- a/phpBB/docs/nginx.sample.conf +++ b/phpBB/docs/nginx.sample.conf @@ -1,7 +1,11 @@ # Sample nginx configuration file for phpBB. -# Global settings have been removed, copy them -# from your system's nginx.conf. -# Tested with nginx 0.8.35. +# Tested with: +# - nginx 0.8.35 +# - nginx 1.17.7 (mainline) +# +# Filename: /etc/nginx/sites-available/example.com.conf +# +# Replace example.com with your own domain name. # If you want to use the X-Accel-Redirect feature, # add the following to your config.php. @@ -11,117 +15,89 @@ # See http://wiki.nginx.org/XSendfile for the details # on X-Accel-Redirect. -http { - # Compression - requires gzip and gzip static modules. - gzip on; - gzip_static on; - gzip_vary on; - gzip_http_version 1.1; - gzip_min_length 700; - - # Compression levels over 6 do not give an appreciable improvement - # in compression ratio, but take more resources. - gzip_comp_level 6; - - # IE 6 and lower do not support gzip with Vary correctly. - gzip_disable "msie6"; - # Before nginx 0.7.63: - #gzip_disable "MSIE [1-6]\."; - - # Catch-all server for requests to invalid hosts. - # Also catches vulnerability scanners probing IP addresses. - server { - # default specifies that this block is to be used when - # no other block matches. - listen 80 default; - - server_name bogus; - return 444; - root /var/empty; - } - - # If you have domains with and without www prefix, - # redirect one to the other. - server { - # Default port is 80. - #listen 80; - - server_name myforums.com; - - # A trick from http://wiki.nginx.org/Pitfalls#Taxing_Rewrites: - return 301 http://www.myforums.com$request_uri; - } - - # The actual board domain. - server { - #listen 80; - server_name www.myforums.com; - - root /path/to/phpbb; - - location / { - # phpBB uses index.htm - index index.php index.html index.htm; - try_files $uri $uri/ @rewriteapp; - } - - location @rewriteapp { - rewrite ^(.*)$ /app.php/$1 last; - } - - # Deny access to internal phpbb files. - location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(? $NGINX_PHP_CONF + +sudo mv "$NGINX_PHP_CONF" /etc/nginx/conf.d/php.conf + +sudo nginx -T sudo service nginx start -- cgit v1.2.3-65-gdbad