简体   繁体   English

Laradock - Localhost拒绝使用Nginx在Windows 10上连接

[英]Laradock - Localhost refused to connect on Windows 10 using Nginx

I have setup a laradock app on my local machine. 我在本地机器上安装了一个laradock应用程序。 I have followed the instructions as provided: http://laradock.io/ 我按照提供的说明操作: http//laradock.io/

In addition to that as I am on Windows 10, and using Docker toolbox, I have shared my folder with the laradock's workspace. 除了我在Windows 10上,并使用Docker工具箱,我已经与laradock的工作区共享我的文件夹。 That's working fine as I can see my app's folders inside the workspace when I run the following command 这工作正常,因为当我运行以下命令时,我可以在工作区内看到我的应用程序文件夹

docker-compose exec workspace bash

I have also added a host entry inside my hosts file on windows. 我还在Windows上的hosts文件中添加了一个主机条目。 127.0.0.1 localhost

But nothing works. 但没有任何作用。 I get a response 'localhost refused to connect'. 我收到回复'localhost拒绝连接'。 Even css files inside public folder are not accessible 甚至公共文件夹中的css文件也无法访问

You should checkout the nginx/sites folder inside your laradock folder. 你应该检查你的laradock文件夹中的nginx/sites文件夹。 Check the root path inside default.conf - root /var/www/public; 检查default.conf的根路径 - root /var/www/public; should correspond to where your project /public folder actually is inside workspace . 应该对应于项目/public文件夹实际位于workspace区内的位置。

I personally use laradock for many projects and create multiple .conf files that correspond to my sites name like myproject1.test - myproject1.conf and my file structure is like that: 我个人在许多项目中使用laradock并创建多个.conf文件,这些文件对应于我的网站名称,如myproject1.test - myproject1.conf ,我的文件结构是这样的:

/laradock
/myproject1
/myproject2

hosts file: 主机文件:

127.0.0.1 myproject1.test
127.0.0.1 myproject2.test

myproject1.conf inside nginx/sites : nginx/sites myproject1.conf

...
server_name myproject1.test;
root /var/www/myproject1/public;
...

Hope that helps 希望有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Laradock-Localhost在使用Nginx的Windows 7上不起作用 - Laradock - Localhost not working on Windows 7 using Nginx 如何使用laradock与postgres配置laravel? 无法连接到服务器:端口5432上的连接被拒绝 - how to configure laravel with postgres using laradock? could not connect to server: Connection refused on port 5432 Localhost 拒绝使用 laravel sail (Docker) 连接 - Localhost refused to connect using laravel sail (Docker) 我如何解决在 laradock selenium 中连接失败和连接被拒绝的问题 - how i can fix Failed to connect and Connection refused in laradock selenium 连接被拒绝:无法连接到 127.0.0.1 端口 4444:连接被拒绝 laravel 黄昏与 selenium 和 laradock - Connection Refused : Failed to connect to 127.0.0.1 port 4444: Connection refused laravel dusk with selenium and laradock Docker Nginx PHP Laravel curl failed to connect to api.localhost port 80. Connection refused - Docker Nginx PHP Laravel curl failed to connect to api.localhost port 80. Connection refused Laradock:本地主机上的多个项目 - Laradock: multiple projects on localhost Laradock 404 未找到 nginx - Laradock 404 not found nginx 使用LaraDock在Nginx上运行Laravel时找不到文件 - File Not Found when running Laravel with Nginx using LaraDock Windows上的Laradock(容器)文件 - Laradock (container) files on Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM