Laravel 部署Aws Nginx服务器

如果部署应用的服务器运行的是 Nginx,可以使用下面的配置文件配置 Web 服务器

server {
	  listen 80;
	  server_name aaa.com;
	  root /home/cgpay/public;
      
      	  add_header X-Frame-Options "SAMEORIGIN";
       	  add_header X-XSS-Protection "1; mode=block";
       	  add_header X-Content-Type-Options "nosniff";

          index index.php;
          charset utf-8;
      
       	  location / {
	       try_files $uri $uri/ /index.php?$query_string;
	  }
                                           
	  location = /favicon.ico { access_log off; log_not_found off; }
          location = /robots.txt  { access_log off; log_not_found off; }

          error_page 404 /index.php;
                                                      
	  location ~ \.php$ {
		 fastcgi_pass unix:/run/php-fpm/www.sock;
	         fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 
                 include fastcgi_params;
											        
	  }

	 location ~ /\.(?!well-known).*{
	    deny all;
         }
	 listen 443 ssl;
	     server_name  apitest.cwalletco.com;

	     ssl_certificate     /etc/nginx/ssl/nginx.crt;
             ssl_certificate_key /etc/nginx/ssl/nginx.key;

	     access_log  /var/log/nginx/apo.com_access_ssl.log  main;
             error_log  /var/log/nginx/app.com_error_ssl.log;
				    
}

如果你想要一个工具来协助管理服务器,可以考虑使用 Laravel Forge):