404 after changing Apache to Nginx PhP 7 1.8?

Windows 10, Apache, PhP 7, PhP, 7.1, 5.4 Laravel, Openserver.
I tried to change the Nginx module on 1.8, now when I try to go to the site throws the error:
404 Not Found
nginx

:(

Apparently I missed out on for the configurations, until I know someone. OpenServer / Laravel / PhP?

#-----------------------------------------------#
# Start of configuration block host
#-----------------------------------------------#

server {
 listen %ip%:%httpport%;
 listen %ip%:%httpsport% ssl;
 server_name %host% %aliases%;

 ssl_certificate "%sprogdir%/userdata/config/cert_files/server.crt";
 ssl_certificate_key "%sprogdir%/userdata/config/cert_files/server.key";

 #add_header Strict-Transport-Security "max-age=94608000";

 # if ($request_method !~* ^(GET|HEAD|POST)$ ){return 403;}
 location ~ /\. {deny all;}

 location / {
 root "%hostdir%";
 index index.php index.html index.htm;
}

 location ~ \.php$ {
 root "%hostdir%";
 try_files $uri =404;
 # if (!-e $document_root$document_uri){return 404;}
 location backend;
 fastcgi_index index.php;
 fastcgi_buffers directives 4 64k;
 fastcgi_connect_timeout 1s;
 fastcgi_ignore_client_abort off;
 fastcgi_next_upstream timeout;
 fastcgi_read_timeout 5m;
 fastcgi_send_timeout 5m;
 fastcgi_param CONTENT_TYPE $content_type;
 fastcgi_param CONTENT_LENGTH $content_length;
 fastcgi_param DOCUMENT_URI $document_uri;
 fastcgi_param DOCUMENT_ROOT $document_root;
 fastcgi_param GATEWAY_INTERFACE CGI/1.1;
 fastcgi_param HTTPS $https;
 fastcgi_param QUERY_STRING $query_string;
 fastcgi_param REQUEST_METHOD $request_method;
 fastcgi_param REQUEST_URI $request_uri;
 fastcgi_param REMOTE_ADDR $remote_addr;
 fastcgi_param REMOTE_PORT $remote_port;
 fastcgi_param SERVER_ADDR $server_addr;
 fastcgi_param SERVER_PORT $server_port;
 fastcgi_param SERVER_NAME $host;
 fastcgi_param SERVER_PROTOCOL $server_protocol;
 fastcgi_param SERVER_SOFTWARE nginx;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
 fastcgi_param TMP "%sprogdir%/userdata/temp";
 fastcgi_param TMPDIR "%sprogdir%/userdata/temp";
 fastcgi_param TEMP "%sprogdir%/userdata/temp";
}

 # Connection web tools
#---------------------------------------#
 # <Do not change this configuration block>
 location /openserver/ {
 root "%sprogdir%/modules/system/html";
 index index.php;
 %allow%allow all;
 allow 127.0.0.0/8;
 allow ::1/128;
 allow %ips%;
 deny all;
 location /openserver/server-status {
 stub_status on;
}
 location ~ ^/openserver/.*\.php$ {
 root "%sprogdir%/modules/system/html";
 location backend;
 fastcgi_index index.php;
 fastcgi_buffers directives 4 64k;
 fastcgi_connect_timeout 1s;
 fastcgi_ignore_client_abort off;
 fastcgi_next_upstream timeout;
 fastcgi_read_timeout 5m;
 fastcgi_send_timeout 5m;
 fastcgi_param CONTENT_TYPE $content_type;
 fastcgi_param CONTENT_LENGTH $content_length;
 fastcgi_param DOCUMENT_URI $document_uri;
 fastcgi_param DOCUMENT_ROOT $document_root;
 fastcgi_param GATEWAY_INTERFACE CGI/1.1;
 fastcgi_param HTTPS $https;
 fastcgi_param QUERY_STRING $query_string;
 fastcgi_param REQUEST_METHOD $request_method;
 fastcgi_param REQUEST_URI $request_uri;
 fastcgi_param REMOTE_ADDR $remote_addr;
 fastcgi_param REMOTE_PORT $remote_port;
 fastcgi_param SERVER_ADDR $server_addr;
 fastcgi_param SERVER_PORT $server_port;
 fastcgi_param SERVER_NAME $host;
 fastcgi_param SERVER_PROTOCOL $server_protocol;
 fastcgi_param SERVER_SOFTWARE nginx;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
 fastcgi_param TMP "%sprogdir%/userdata/temp";
 fastcgi_param TMPDIR "%sprogdir%/userdata/temp";
 fastcgi_param TEMP "%sprogdir%/userdata/temp";
}
}
 # <Do not change this configuration block/>
#---------------------------------------#
}

#-----------------------------------------------#
# End of configuration block host
#-----------------------------------------------#
June 26th 19 at 14:26
3 answers
June 26th 19 at 14:28
Solution
Added to the beginning of the configuration file of the web server nginx:
server {
 listen 80;
 server_name mysite.ru; // host Name
 index index.php;
 root path to the site root;
 location / {
 try_files try_files $uri $uri/ /index.php?$query_string;
}
 location ~ \.php$ {
 root "%sprogdir%/modules/system/html";
 location backend;
 fastcgi_index index.php;
 fastcgi_buffers directives 4 64k;
 fastcgi_connect_timeout 1s;
 fastcgi_ignore_client_abort off;
 fastcgi_next_upstream timeout;
 fastcgi_read_timeout 5m;
 fastcgi_send_timeout 5m;
 fastcgi_param CONTENT_TYPE $content_type;
 fastcgi_param CONTENT_LENGTH $content_length;
 fastcgi_param DOCUMENT_URI $document_uri;
 fastcgi_param DOCUMENT_ROOT $document_root;
 fastcgi_param GATEWAY_INTERFACE CGI/1.1;
 fastcgi_param HTTPS $https;
 fastcgi_param QUERY_STRING $query_string;
 fastcgi_param REQUEST_METHOD $request_method;
 fastcgi_param REQUEST_URI $request_uri;
 fastcgi_param REMOTE_ADDR $remote_addr;
 fastcgi_param REMOTE_PORT $remote_port;
 fastcgi_param SERVER_ADDR $server_addr;
 fastcgi_param SERVER_PORT $server_port;
 fastcgi_param SERVER_NAME $host;
 fastcgi_param SERVER_PROTOCOL $server_protocol;
 fastcgi_param SERVER_SOFTWARE nginx;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
 fastcgi_param TMP "%sprogdir%/userdata/temp";
 fastcgi_param TMPDIR "%sprogdir%/userdata/temp";
 fastcgi_param TEMP "%sprogdir%/userdata/temp";
}
}


In the hosts file add:
127.0.0.1 mysite.ru

Thus, we get a separate host configuration mysite.ru.
serv stopped zapuskatsya - jaycee commented on June 26th 19 at 14:31
: Of course stopped, I missed the last parenthesis. - Manuela.Ho commented on June 26th 19 at 14:34
: all earned, thanks - jaycee commented on June 26th 19 at 14:37
June 26th 19 at 14:30
Nginx configs of course most likely under one set. Your website most likely under another and, accordingly, Apache, besides from htaccess, you can disable
removed .htaccess is still wrong. - jaycee commented on June 26th 19 at 14:33
: what's the General .htaccess? - Manuela.Ho commented on June 26th 19 at 14:36
I don't know, try that comes - jaycee commented on June 26th 19 at 14:39
: Print error in the config file (likely file php-fpm.conf):
php_flag[display_errors] = on
php_flag[display_startup_errors] = on
- jaycee commented on June 26th 19 at 14:42
: I have these flags and stand to config PHP - Manuela.Ho commented on June 26th 19 at 14:45
: search for a file in the project and in the folder Openserver gave nothing php-fpm.conf - jaycee commented on June 26th 19 at 14:48
June 26th 19 at 14:32
location / {
 try_files $uri $uri/ /index.php?$query_string;
 }
where this sculpt - jaycee commented on June 26th 19 at 14:35

Find more questions by tags ApacheHostingNginx