N
N
Nick Bukovskiy2017-03-20 23:10:18
Nginx
Nick Bukovskiy, 2017-03-20 23:10:18

What is wrong with nginx configuration?

I use windows. An nginx server is installed on virtualbox (build using puphpet.com).
-I created a config in nginx/site-availble/vb-dev.conf with the content:

server {
listen *:80;

server_name vb-dev;
client_max_body_size 1m;

root /var/www/vb-dev/public;
index index index.html index.htm index.php;

access_log /var/log/nginx/vb-dev.access.log;
error_log /var/log/nginx/vb-dev.error.log;

i
location / {
try_files $uri $uri/ /index.php?_url=$uri&$args;
autoindex off;
}

location ~ \.php$ {

fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
try_files $uri /index.php =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php7.0-fpm.socket;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name
fastcgi_param APP_ENV dev;

}

sendfile off;
}

- on Windows, in the hosts file, added the line 127.0.0.1 vb-dev
- the project is located at share/vb-dev/public/index.php
, but when vb-dev/ is entered in the browser, it does not enter the site. What's my mistake? Help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kulik, 2017-03-20
@lnkvisitor

You need to specify the address of the virtual machine in hosts and not the local one

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question