cloudrck Posted May 31, 2013 Report Share Posted May 31, 2013 Nginx has a system similar to Apaches mod_rewrite, while at the same time being completely different. It's also very robust, with the ability to use Perl or any other scripting language. This would go in the server{} area for your particular domain. Of course, there are more than one way to achieve rewriting for Blesta with Nginx, but I think this is the most efficient, and avoids the evil IF-IS many people use with Nginx configurations. If anybody is interested, there are loads of other settings that I use to speed Blesta up, which I'm still working on at the moment. To make it easier to update https://github.com/cloudrck/blesta-nginx location ~ (\.pdt) { return 403; } location / { error_page 404 = @blesta; log_not_found off; if ($request_uri ~ "^(.*)/install.php$"){ rewrite install.php /%1/install/ redirect; } } location @blesta { rewrite ^(.*)$ /index.php last; } m0hamedessam 1 Quote Link to comment Share on other sites More sharing options...
Paul Posted May 31, 2013 Report Share Posted May 31, 2013 This is great, actually we should put it in the documentation. Would love to see the settings you use to speed up Blesta too. Thanks for sharing! Quote Link to comment Share on other sites More sharing options...
cloudrck Posted May 31, 2013 Author Report Share Posted May 31, 2013 Nginx has a learning curve when coming from Apache. A handful of the default configurations of PHP/FCGI from vendors don't go so well with Nginx. As with SSL, I found Nginx will want to start the handshake from scratch each page load. And the stock FPM Process Management settings are set very low. I'll post a lot more soon. I only use PHP-FPM at the moment, rather than plain CGI. As I think it's a much better process manager Quote Link to comment Share on other sites More sharing options...
e.leval Posted June 12, 2013 Report Share Posted June 12, 2013 guys, im facing problem with nginx, the same config im using which you showed in github. domain.com/amc/admin/login/setup gives me 404. even install gave 404. is there anyone who could help me out? Quote Link to comment Share on other sites More sharing options...
RRWH Posted August 29, 2013 Report Share Posted August 29, 2013 Been sorting out a few Nginx Issues as well - especially around forcing everything to use https If you need a hand generating your CSR and a self-signed cert for testing I think I have a guide somewhere as well. My stack where blesta is installed is a centminmod install, and then I just added a vhost where I installed Blesta in the root. My complete sanitized vhost config file is included for reference. server { server_name namegoeshere.com; access_log /path/to/access.log combined buffer=32k; error_log /path/to/error.log; root /path/to/docroot; listen 80; listen 443 default ssl; ssl on; ssl_certificate /path to/certificate.crt; ssl_certificate_key /path/to/ssl.key; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM; ssl_prefer_server_ciphers on; # Force All pages to use SSL if ($ssl_protocol = "") { rewrite ^ https://$server_name$request_uri? permanent; } location ~ (\.pdt) { return 403; } location / { error_page 404 = @blesta; log_not_found off; if ($request_uri ~ "^(.*)/install.php$"){ rewrite install.php /%1/install/ redirect; } } location @blesta { rewrite ^(.*)$ /index.php last; } include /path/to/php.conf; } Specific Issue that I had using the centminmod stack was I had to remove the included config file for staticfiles - it sets cache headers for several static files and was causing issues with the navigation in the admin panel (css). For fine-tuning, I will probably make a copy of this file and remove just the css stuff to keep it all as fast as possible. eva2000 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.