Sudo nano etcnginxsites-availablelaravelonf
server {
listen 80;
listen[::]:80;
server_namelaravel.example;
root varlaravelapppublic;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index indexhp;
charset utf-8;
location{
try_files $uri $uri indexhp?$query_string;
}
location = favicon.ico { access_log off; log_not_found off; }
location = robotsxt { access_log off; log_not_found off; }
error_page 404 indexhp;
location ~ \hp$ {
fastcgi_pass unix:varrunphpphp8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ \.?!well-known. {
deny all;
}
}
Save the file.
Then run the commands below to enable the virtual host and philippines telegram data restart the Nginx server.
sudo ln -s etcnginxsites-availablelaravelonf etcnginxsites-enabled
sudo systemctl restart nginx.service
Setting up Let's Encrypt SSLTLS for Laravel
You may want to install an SSLTLS certificate to secure your Laravel site. Secure your Laravel installation with S from Let's Encrypt.
After restarting the Nginx web server, open your browser and navigate to the server hostname or IP address defined in the Nginx server block.
:laravel.example
Your Laravel site should be set up and ready to use.