Advertisement
Guest User

nginx symfony conf

a guest
Oct 14th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen 443 ssl http2;
  4. server_name symfony.app;
  5. root "/home/vagrant/code/aqua_note/web";
  6.  
  7. index index.html index.htm index.php app_dev.php;
  8.  
  9. charset utf-8;
  10.  
  11. location / {
  12. try_files $uri $uri/ /app_dev.php?$query_string;
  13. }
  14.  
  15. location = /favicon.ico { access_log off; log_not_found off; }
  16. location = /robots.txt { access_log off; log_not_found off; }
  17.  
  18. access_log off;
  19. error_log /var/log/nginx/symfony.app-ssl-error.log error;
  20.  
  21. sendfile off;
  22.  
  23. client_max_body_size 100m;
  24. # DEV
  25. location ~ ^/(app_dev|app_test|config)\.php(/|$) {
  26. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  27. fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
  28. include fastcgi_params;
  29. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  30.  
  31.  
  32. fastcgi_intercept_errors off;
  33. fastcgi_buffer_size 16k;
  34. fastcgi_buffers 4 16k;
  35. }
  36.  
  37. # PROD
  38. location ~ ^/app\.php(/|$) {
  39. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  40. fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
  41. include fastcgi_params;
  42. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  43.  
  44.  
  45. fastcgi_intercept_errors off;
  46. fastcgi_buffer_size 16k;
  47. fastcgi_buffers 4 16k;
  48. internal;
  49. }
  50. location ~ /\.ht {
  51. deny all;
  52. }
  53.  
  54. ssl_certificate /etc/nginx/ssl/symfony.app.crt;
  55. ssl_certificate_key /etc/nginx/ssl/symfony.app.key;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement