# Nginx

# Configuración para react router en nginx

```shell
# En el archivo /etc/nginx/conf.d/default.conf
# dentro de server {}
# debe estar:

location / {
  root   /usr/share/nginx/html;
  index  index.html index.htm;
  try_files $uri /index.html;
}
```

# Comandos NGINX

```shell
service nginx start
```

# Nginx config laravel

```shell
location / {
        try_files $uri $uri/ /index.php?$query_string;        
    }


	# pass PHP scripts to FastCGI server
	#
	location ~ \.php$ {
         try_files $uri =404;
         fastcgi_split_path_info  ^(.+\.php)(/.+)$;
         fastcgi_index            index.php;
         fastcgi_pass             unix:/var/run/php/php7.2-fpm.sock;
         include                  fastcgi_params;
         fastcgi_param   PATH_INFO       $fastcgi_path_info;
         fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
```