mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/14271] Properly use try_files in nginx sample config
PHPBB3-14271
This commit is contained in:
parent
b27be0b857
commit
966c34d0ad
1 changed files with 4 additions and 6 deletions
|
@ -61,13 +61,10 @@ http {
|
||||||
|
|
||||||
root /path/to/phpbb;
|
root /path/to/phpbb;
|
||||||
|
|
||||||
# strip app.php/ prefix if it is present
|
|
||||||
rewrite ^/app\.php/?(.*)$ /$1 permanent;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# phpbb uses index.htm
|
# phpbb uses index.htm
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
try_files $uri @rewriteapp;
|
try_files $uri $uri/ @rewriteapp;
|
||||||
}
|
}
|
||||||
|
|
||||||
location @rewriteapp {
|
location @rewriteapp {
|
||||||
|
@ -83,14 +80,15 @@ http {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Pass the php scripts to fastcgi server specified in upstream declaration.
|
# Pass the php scripts to fastcgi server specified in upstream declaration.
|
||||||
location ~ \.php {
|
location ~ \.php(/|$) {
|
||||||
# Unmodified fastcgi_params from nginx distribution.
|
# Unmodified fastcgi_params from nginx distribution.
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
# Necessary for php.
|
# Necessary for php.
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||||
fastcgi_param PATHINFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||||
|
try_files $uri $uri/ /app.php$is_args$args;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue