You are not logged in.
Pages: 1
Hi all,
Spent a while playing around trying to get BigTree to play nice on Nginx having had searches come up blank, and have just registered to share my results on here for anyone else who they may be of use to...
server { server_name [domain] www.[domain]; listen 80; root [path to web root]/site; index index.php index.html index.htm; sendfile off; location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite ^/(.*)$ /index.php?bigtree_htaccess_url=$1; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass [socket path]; fastcgi_index index.php; include fastcgi_params; } }
Notably the try_files order and "sendfile off;" were particularly important in ensuring things worked correctly.
This then requires routing to be set as "htaccess" in /custom/environment.php like so:
$bigtree["config"]["routing"] = "htaccess";
Got one BigTree site running very happily on Nginx 1.4.6, with another in the pipework!
Feel free to use this config for your own purposes and for documentation should you wish. Keep up the great work!
-Rebecca
Offline
That's excellent! Thank you for sharing -- I'll try to get this integrated into the documentation (and maybe the 4.2 installer). I'd meant to look into nginx support but got sidetracked a while back and forgot about it. Congrats on the site launch, hope the next one goes smoothly! If you have any questions feel free to post here or drop me an email
Offline
I setup a Vagrant environment and tested out your config but was having issues with it parsing PHP until I added something from the default PuPHPet config:
fastcgi_param SCRIPT_FILENAME $request_filename;
Prior to the "include fastcgi_params" line.
It's entirely possible this is due to my Vagrant setup -- looks like the default in fastcgi_params is:
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
The nginx docs say it should be $document_root$fastcgi_script_name by default, so it's probably my silly Vagrant setup that has the defaults wrong.
Offline
Pages: 1