symfony.conf.example 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. # For https
  5. # listen 443 ssl;
  6. # listen [::]:443 ssl ipv6only=on;
  7. # ssl_certificate /etc/nginx/ssl/default.crt;
  8. # ssl_certificate_key /etc/nginx/ssl/default.key;
  9. server_name symfony.test;
  10. root /var/www/projects/symfony/web;
  11. index index.php index.html index.htm;
  12. location / {
  13. try_files $uri @rewriteapp;
  14. }
  15. # For Symfony 3
  16. location @rewriteapp {
  17. rewrite ^(.*)$ /app.php/$1 last;
  18. }
  19. # For Symfony 4 config
  20. # location @rewriteapp {
  21. # rewrite ^(.*)$ /index.php/$1 last;
  22. # }
  23. location ~ ^/(app|app_dev|config|index)\.php(/|$) {
  24. fastcgi_pass php-upstream;
  25. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  26. include fastcgi_params;
  27. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  28. #fixes timeouts
  29. fastcgi_read_timeout 600;
  30. fastcgi_param HTTPS off;
  31. }
  32. error_log /var/log/nginx/symfony_error.log;
  33. access_log /var/log/nginx/symfony_access.log;
  34. }