Run php artisan serve in the virtual machine (192.168.73.130)
Laravel development server started on http://localhost:8000/
Visit http://192.168.73.130:8000
Result: ERR_CONNECTION_REFUSED
So configure a forwarding in the virtual machine nginx:
<code>server { listen 0.0.0.0:80; server_name lara.com; location / { proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:8000; #proxy_buffering off; proxy_redirect on; } } </code>
When accessing lara.com in the local browser, it shows 502 Bad Gateway
If you go to curl http://localhost:8000/ in the shell, there will be HTML returned
Is my nginx configuration wrong?
Please solve (Laravel’s environment is very troublesome) ! ! )
Run php artisan serve in the virtual machine (192.168.73.130)
Laravel development server started on http://localhost:8000/
Visit http://192.168.73.130:8000
Result: ERR_CONNECTION_REFUSED
So configure a forwarding in the virtual machine nginx:
<code>server { listen 0.0.0.0:80; server_name lara.com; location / { proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:8000; #proxy_buffering off; proxy_redirect on; } } </code>
When accessing lara.com in the local browser, it shows 502 Bad Gateway
If you go to curl http://localhost:8000/ in the shell, there will be HTML returned
Is my nginx configuration wrong?
Please solve (Laravel’s environment is very troublesome) ! ! )