add the /forum location in nginx
location /forum {
root [path to www]/forum;
try_files $uri $uri/ [index location];
}
I haven't used phbb3 before, so I don't know the exact index location for it.
سؤال
I have a symfony2 app running on www.sampledomain.com, with nginx as my webserver.
I'd like to run a phpbb3 forum in a subdirectory, www.sampledomain.com/forum
Symfony is capturing the request and posting a 404 as there is no route setup, however the phbb3 files exist in the /forum directory.
I've searched the documentation but cannot see a way to tell symfony2 to "pass through" requests to /forum. Is this possible?
Update #1: My nginx configuration, as requested:
server {
listen 80;
client_header_timeout 600s;
client_body_timeout 600s;
server_name www.sampledomain.com;
root /home/ec2-user/www/sampledomain/www/web;
access_log /var/log/www.sampledomain.com.access_log;
error_log /var/log/www.sampledomain.com.error_log;
# strip app.php/ prefix if it is present
rewrite ^/app\.php/?(.*)$ /$1 permanent;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#try_files $uri /index.php;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/ec2-user/www/sampledomain/www/web$fastcgi_script_name;
send_timeout 600s;
fastcgi_read_timeout 5m;
#fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
المحلول
add the /forum location in nginx
location /forum {
root [path to www]/forum;
try_files $uri $uri/ [index location];
}
I haven't used phbb3 before, so I don't know the exact index location for it.