default.conf 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. upstream php-upstream {
  2. server php-fpm:9000;
  3. }
  4. server {
  5. listen 80 default_server;
  6. listen [::]:80 default_server ipv6only=on;
  7. # For https
  8. # listen 443 ssl default_server;
  9. # listen [::]:443 ssl default_server ipv6only=on;
  10. # ssl_certificate /etc/nginx/ssl/default.crt;
  11. # ssl_certificate_key /etc/nginx/ssl/default.key;
  12. server_name localhost;
  13. root /var/www/public;
  14. index index.php index.html index.htm;
  15. location / {
  16. try_files $uri $uri/ /index.php$is_args$args;
  17. }
  18. location ~ \.php$ {
  19. try_files $uri /index.php =404;
  20. fastcgi_pass php-upstream;
  21. fastcgi_index index.php;
  22. fastcgi_buffers 16 16k;
  23. fastcgi_buffer_size 32k;
  24. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  25. #fixes timeouts
  26. fastcgi_read_timeout 600;
  27. include fastcgi_params;
  28. }
  29. location ~ /\.ht {
  30. deny all;
  31. }
  32. location /.well-known/acme-challenge/ {
  33. root /var/www/letsencrypt/;
  34. log_not_found off;
  35. }
  36. }