php - laravel inner pages are not working on AWS EC2 Nginx -
i working on laravel v5.1.11
site hosted on aws ec2 ubuntu
ngnix
server. setup site inner page not working.
config is:
server { listen 82; server_name www.example.com; return 301 https://$server_name$request_uri; } server { listen 83; server_name www.example.com; root /home/in4matic/example-website-dev/public; location / { index index.php; try_files $uri $uri/ /index.php?q=$uri&$args; } location ~* \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; #fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param path_info $fastcgi_path_info; #fastcgi_param script_filename $document_root$fastcgi_script_name; fastcgi_param script_filename $document_root/index.php; #fastcgi_param path_translated $document_root$fastcgi_path_info; fastcgi_param script_name $fastcgi_script_name; } }
how can fix that.
moving laravel app apache nginx doesn't require many modification, because laravel uses .htaccess file url rewrite won't work in nginx, have modify nginx config file nginx can rewrite url. here example of config file :
server { listen 80; server_name your-website.com; # note these lines "location /" block root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000 # keep per old config; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; include fastcgi_params; } }
i have been using config of laravel app.
and make sure storage directory has proper permission.
Comments
Post a Comment