The official, canonical postActiv repository. http://www.postactiv.com

nginx.conf.sample 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. # FIXME: change domain name here (and also make sure you do the same in the next 'server' section)
  5. server_name social.example.org;
  6. # redirect all traffic to HTTPS
  7. rewrite ^ https://$server_name$request_uri? permanent;
  8. }
  9. server {
  10. # Use HTTPS. Seriously. Set it up with a cert (any cert) before you run the install.
  11. listen 443 ssl;
  12. # Server name
  13. # Change "social.example.org" to your site's domain name
  14. server_name social.example.org;
  15. # SSL
  16. # Uncomment and change the paths to setup
  17. # your SSL key/cert. See https://cipherli.st/
  18. # for more information
  19. ssl_certificate ssl/certs/social.example.org.crt;
  20. ssl_certificate_key ssl/private/social.example.org.key;
  21. # Logs
  22. # Uncomment and change the paths to setup
  23. # logging
  24. #access_log /path/to/access.log;
  25. #error_log /path/to/error.log;
  26. # Root
  27. # Change the path below to where you installed
  28. # GNU social
  29. root /path/to/gnusocial/root;
  30. # Index
  31. index index.php;
  32. # PHP
  33. location ~ \.php {
  34. include fastcgi_params;
  35. # This should be the same value as in your (optional) /etc/php5/fpm/pool.d/$server.conf
  36. fastcgi_pass unix:/var/run/php5-fpm.sock;
  37. # Remove the "fastcgi_pass" line above and uncomment
  38. # the one below to use TCP sockets instead of Unix sockets
  39. #fastcgi_pass 127.0.0.1:9000;
  40. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  41. }
  42. # Location
  43. location / {
  44. try_files $uri $uri/ @gnusocial;
  45. }
  46. # Fancy URLs
  47. location @gnusocial {
  48. rewrite ^(.*)$ /index.php?p=$1 last;
  49. }
  50. # Restrict access that is unnecessary anyway
  51. location ~ /\.(ht|git) {
  52. deny all;
  53. }
  54. }