diff options
author | Maat <maat-pub@mageia.biz> | 2020-05-08 21:52:11 +0200 |
---|---|---|
committer | Maat <maat-pub@mageia.biz> | 2020-05-08 21:52:11 +0200 |
commit | 8ea437e30605e0f66b5220bf904a61d7c1d11ddd (patch) | |
tree | e0db2bb4a012d5b06a633160b19f62f4868ecd28 /phpBB/docs/nginx.sample.conf | |
parent | 36bc1870f21fac04736a1049c1d5b8e127d729f4 (diff) | |
parent | 2fdd46b36431ae0f58bb2e78e42553168db9a0ff (diff) | |
download | forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.gz forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.bz2 forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.xz forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.zip |
Merge remote-tracking branch 'upstream/prep-release-3.2.9'
Diffstat (limited to 'phpBB/docs/nginx.sample.conf')
-rw-r--r-- | phpBB/docs/nginx.sample.conf | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf index bf33f4e73d..c5a9472a1c 100644 --- a/phpBB/docs/nginx.sample.conf +++ b/phpBB/docs/nginx.sample.conf @@ -18,11 +18,11 @@ http { 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: @@ -49,9 +49,7 @@ http { server_name myforums.com; # A trick from http://wiki.nginx.org/Pitfalls#Taxing_Rewrites: - rewrite ^ http://www.myforums.com$request_uri permanent; - # Equivalent to: - #rewrite ^(.*)$ http://www.myforums.com$1 permanent; + return 301 http://www.myforums.com$request_uri; } # The actual board domain. @@ -62,7 +60,7 @@ http { root /path/to/phpbb; location / { - # phpbb uses index.htm + # phpBB uses index.htm index index.php index.html index.htm; try_files $uri $uri/ @rewriteapp; } @@ -72,7 +70,7 @@ http { } # Deny access to internal phpbb files. - location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|phpbb|store|vendor) { + location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb(?!\w+)|store|vendor) { deny all; # deny was ignored before 0.8.40 for connections over IPv6. # Use internal directive to prohibit access on older versions. @@ -92,6 +90,29 @@ http { fastcgi_pass php; } + # Correctly pass scripts for installer + location /install/ { + # phpBB uses index.htm + try_files $uri $uri/ @rewrite_installapp =404; + + # Pass the php scripts to fastcgi server specified in upstream declaration. + location ~ \.php(/|$) { + # Unmodified fastcgi_params from nginx distribution. + include fastcgi_params; + # Necessary for php. + fastcgi_split_path_info ^(.+\.php)(/.*)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + try_files $uri $uri/ /install/app.php$is_args$args =404; + fastcgi_pass php; + } + } + + location @rewrite_installapp { + rewrite ^(.*)$ /install/app.php/$1 last; + } + # Deny access to version control system directories. location ~ /\.svn|/\.git { deny all; |