Report this

What is the reason for this report?

laravel 5 application download file instead of execute on LEMP

Posted on August 8, 2017

hello now I try to deploy two project in one droplet one for front end ( angular js application) and each other for api (laravel application) and this point to sub-domin i followed this tutorial for do this 1- create sup domain here 2- deploy to project in one deoplet here 3- delopy larave on LEMP here

the front end app work fine but backend in laravel when I access to it file in public download instead of execute

this is my web site config this for front end

server {
	listen 80;
	listen [::]:80;

	root /var/www/panakeis_front/html;
	index index.php index.html index.htm;

	# Make site accessible from http://localhost/
	server_name panakeias.con www.panakeias.com;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
                  try_files $uri $uri/ /index.php?$query_string;
		# Uncomment to enable naxsi on this location
		# include /etc/nginx/naxsi.rules
	}

	error_page 404 /404.html;
	error_page 500 502 503 504 /50x.html;
	location = /50x.html {
		root /usr/share/nginx/html;
	}

	location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
	}

	# deny access to .htaccess files, if Apache's document root
	# concurs with nginx's one
	#
	#location ~ /\.ht {
	#	deny all;
	#}
}

this for backe end ( project contain issue )

server {
	listen 80;
	listen [::]:80 ;

	# SSL configuration
	#
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	root /var/www/panakeis_project/html;
	# Add index.php to the list if you are using PHP
	index index.php index.html index.htm index.nginx-debian.html;

	server_name api.panakeias.com www.api.panakeias.com;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ /index.php?$query_string;

	}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.