diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-12-08 19:48:02 +0100 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-12-08 19:48:02 +0100 |
commit | 901785bc5ee46634fcbbb839b95932f13c80253a (patch) | |
tree | 13428aeba1bf0cc0944f075ca048ddc491665dee | |
parent | 81b3b38795749de43c563f7681f18e918902c34e (diff) | |
parent | 966c34d0ad4b64cbf5b35c815c310f24e68224fc (diff) | |
download | forums-901785bc5ee46634fcbbb839b95932f13c80253a.tar forums-901785bc5ee46634fcbbb839b95932f13c80253a.tar.gz forums-901785bc5ee46634fcbbb839b95932f13c80253a.tar.bz2 forums-901785bc5ee46634fcbbb839b95932f13c80253a.tar.xz forums-901785bc5ee46634fcbbb839b95932f13c80253a.zip |
Merge pull request #4018 from marc1706/ticket/14271
[ticket/14271] Update sample config
* marc1706/ticket/14271:
[ticket/14271] Properly use try_files in nginx sample config
[ticket/14271] Improve try_files and use split path info
[ticket/14271] Update sample config
-rw-r--r-- | phpBB/docs/nginx.sample.conf | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf index c82f5c8e49..2ead3552fd 100644 --- a/phpBB/docs/nginx.sample.conf +++ b/phpBB/docs/nginx.sample.conf @@ -64,6 +64,11 @@ http { 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. @@ -75,12 +80,16 @@ http { } # Pass the php scripts to fastcgi server specified in upstream declaration. - location ~ \.php$ { - fastcgi_pass php; - # Necessary for php. - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + 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/ /app.php$is_args$args; + fastcgi_pass php; } # Deny access to version control system directories. |