在虚拟机(192.168.73.130)中 运行 php artisan serve
laravel development server started on http://localhost:8000/
访问http://192.168.73.130:8000
结果:err_connection_refused
于是在虚拟机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>在本地浏览器中访问lara.com显示 502 Bad Gateway
在shell里面去curl http://localhost:8000/ 是会有html返回的
是我的nginx配置不对吗
求解(laravel的环境 好麻烦!!!)
在虚拟机(192.168.73.130)中 运行 php artisan serve
laravel development server started on http://localhost:8000/
访问http://192.168.73.130:8000
结果:err_connection_refused
于是在虚拟机nginx中配置一个转发:
立即学习“PHP免费学习笔记(深入)”;
<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>在本地浏览器中访问lara.com显示 502 Bad Gateway
在shell里面去curl http://localhost:8000/ 是会有html返回的
是我的nginx配置不对吗
求解(laravel的环境 好麻烦!!!)
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号