Advertisement
jimmyfish

Nginx Laravel FPM

Dec 10th, 2019
977
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.68 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     listen [::]:80;
  4.     server_name example.com www.example.com;
  5.  
  6.     root /folder/to/public;
  7.  
  8.     # Add index.php to the list if you are using PHP
  9.     index index.php;
  10.  
  11.     access_log /var/www/nginx-acc.log;
  12.     error_log /var/www/nginx-err.log;
  13.  
  14.     location / {
  15.         error_page 550 = @protected;
  16.         recursive_error_pages on;
  17.  
  18.         try_files $uri $uri/ /index.php@is_args@args;
  19.     }
  20.  
  21.     location ~ \.php$ {
  22.         fastcgi_index index.php;
  23.         fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  24.         fastcgi_keep_conn on;
  25.         include /etc/nginx/fastcgi_params;
  26.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  27.         try_files $uri =404;
  28.     }
  29.  
  30.     location ~/\. {
  31.         deny all;
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement