PHP nginx server Virtual host redirect error -


When I use localhost in url, it redirects to my project, but when I use my project I am. 127.0.0.1.xip.io So it shows that the server did not get the error. Below is my code

Thank you in advance

  Server {Listen 127.0.0.1:80; Server_name myproject.127.0.0.1.xip.io; Root /var/www/dev.myproject.com/webroot; Index index index.php; # End of property expiration for caching place # ~ *. (Ico | css | js | gif | jpe? G | png) (\? [0-9] +)? $ {Maximum is over; Try_files $ uri /index.php; # Log_not_found off; } Locations / {# Check that a file or directory index file exists, otherwise root it at index.php Try_files $ uri $ uri / /index.php; } Place ~ * \ .php $ {try_files $ uri /index.php; Fastcgi_split_path_info ^ (. + Ph.) (/.+) $; # Note: You have "cgi.fix_pathinfo = 0;" Should be # php5-fpm in php.ini: fastcgi_pass unix: /var/run/php5-fpm.sock; Fastcgi_index index.php; Fastcgi_read_timeout 300; Includes fastcgi_params; } Client_max_body_size 10M; }   

Perhaps the hostname can not be resolved, did you 127.0 0.1 myproject.127.0.0.1.xip.io record in your / etc / hosts file?


Comments