nginx.dist 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Elgg Nginx configuration. Customize and put into /etc/nginx/sites-enabled
  2. server {
  3. listen 80;
  4. server_name example.org;
  5. # Server root, replace it with your elgg installation location
  6. root /srv/example.org;
  7. index index.php index.html index.htm;
  8. # Server logs, replace it with your project names
  9. error_log /var/log/nginx/example_error.log;
  10. access_log /var/log/nginx/example_access.log;
  11. location ~ (^\.|/\.) {
  12. return 403;
  13. }
  14. location /cache {
  15. rewrite ^/cache\/(.*)$ /engine/handlers/cache_handler.php?request=$1&$query_string;
  16. }
  17. location /export {
  18. rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/?$ /engine/handlers/export_handler.php?view=$1&guid=$2;
  19. rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ /engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4;
  20. }
  21. location = /rewrite.php {
  22. rewrite ^(.*)$ /install.php;
  23. }
  24. location / {
  25. try_files $uri $uri/ /index.php?__elgg_uri=$uri&$query_string;
  26. }
  27. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  28. #
  29. location ~ \.php$ {
  30. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  31. # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  32. #
  33. # # With php5-cgi alone:
  34. # fastcgi_pass 127.0.0.1:9000;
  35. # # With php5-fpm:
  36. fastcgi_pass unix:/var/run/php5-fpm.sock;
  37. fastcgi_index index.php;
  38. include fastcgi_params;
  39. }
  40. }