@apex1 the following file works perfect:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
# server_name tjhs;
server_name localhost;
location /mini4/ {
root www;
index index.php index.html index.htm;
try_files $uri $uri/ /mini4/index.php?$args;
}
location /tjhs/ {
root www;
index index.php index.html index.htm;
try_files $uri $uri/ /tjhs/index.php?$args;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
include "fastcgi.conf";
root www;
#try_files $uri $uri/ /404.php?$args;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
I just can't get a "named server" like laravel.test or test.laravel to work.
I thought on Windows it should be:
127.0.0.1 laravel.test
In the Windows host file. But I will try another ip to see what happens.
Edit:
I tried the following:
server {
listen 81;
server_name test.laravel;
root /nginx/www/laravel842/public;
location / {
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri /index.php = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
And tried both of these in windows host file:
127.0.0.1 test.laravel
Also tried
192.168.0.7 test.laravel
192.168.0.7 was an available ip address.
Neither work, browser just goes to a search page. However with the same setup. if I put
http://localhost:81/
It still works. Still cannot get a server_name working in Windows 10.