nginx_captive-piratebox.conf 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # PirateBox app for YunoHost
  2. # Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
  3. # Contribute at https://github.com/jvaubourg/piratebox_ynh
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU Affero General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Affero General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. server {
  18. listen 4280 default_server;
  19. listen [::]:4280 default_server;
  20. if ($host != '<TPL:DOMAIN>') {
  21. set $args '';
  22. rewrite ^ http://<TPL:DOMAIN>;
  23. }
  24. location / {
  25. alias <TPL:NGINX_REALPATH>;
  26. client_max_body_size 10G;
  27. index index.php;
  28. try_files $uri $uri/ index.php;
  29. location ~ [^/]\.php(/|$) {
  30. fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  31. fastcgi_pass unix:/var/run/php5-fpm-<TPL:PHP_NAME>.sock;
  32. fastcgi_index index.php;
  33. include fastcgi_params;
  34. fastcgi_read_timeout 600;
  35. fastcgi_send_timeout 600;
  36. fastcgi_param REMOTE_USER $remote_user;
  37. fastcgi_param PATH_INFO $fastcgi_path_info;
  38. }
  39. }
  40. access_log /var/log/nginx/piratebox-access.log;
  41. error_log /var/log/nginx/piratebox-error.log;
  42. }