Nginx Config for Laravel Application
Here is Nginx configuration for a laravel application
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
server { listen 80; server_name www.domain.com; access_log /var/log/nginx/domain.com.log; root /home/domain.com/html/public; index index.html index.php; access_log /var/log/nginx/domain.com.log; error_log /var/log/nginx/domain.com-error.log; client_max_body_size 1000M; proxy_read_timeout 600s; fastcgi_read_timeout 600s; fastcgi_send_timeout 600s; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { try_files $uri =404; access_log off; expires max; } location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_intercept_errors on; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_pass unix:/run/php/php7.2-fpm.sock; } } server { listen 80; server_name domain.com; return 301 http://www.domain.com$request_uri; } |