You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data source services includes an application called nginx-proxy. This allows you to run multiple projects at the same time on different virtual hosts without port conflicts. You do not need to expose the webserver to the host machine through a port map.
3
+
The data source services includes an application called nginx-proxy. This allows you to run multiple projects at the
4
+
same time on different virtual hosts without port conflicts. You do not need to expose the webserver to the host machine
5
+
through a port map.
4
6
5
7
In order for nginx-proxy to operate, you must follow the following steps.
6
8
7
9
## Setup hosts file
8
-
1. Choose a virtual host for your project. RFC-6761 recommends against using a .dev TLD, and instead using a .localhost TLD. Therefore, your domain might be mysite.localhost
9
-
2. Edit your hosts file and add this domain to your loopback address (127.0.0.1) using your preferred text editor. *make sure to use sudo*
10
-
```
10
+
1. Choose a virtual host for your project. RFC-6761 recommends against using a .dev TLD, and instead using a .localhost
11
+
TLD. Therefore, your domain might be mysite.localhost
12
+
2. Edit your hosts file and add this domain to your loopback address (127.0.0.1) using your preferred text editor.
13
+
14
+
```bash
11
15
sudo nano /etc/hosts
12
16
13
-
add:
14
17
127.0.0.1 mysite.localhost
15
18
```
16
19
17
20
## Setup docker-compose for project
18
-
1. In order for nginx-proxy to detect and proxy to the correct virtual host, you must first identify the container that is running the "web server." In a php project, this would be the nginx container, for example.
19
-
2. You will then add an environment variable of `VIRTUAL_HOST=mysite.localhost` to this service, place that service on the nginx-proxy network, and import that nginx-proxy network to the project. See the below snippet:
21
+
1. In order for nginx-proxy to detect and proxy to the correct virtual host, you must first identify the container that
22
+
is running the "web server." In a php project, this would be the nginx container, for example.
23
+
2. You will then add an environment variable of `VIRTUAL_HOST=mysite.localhost` to this service, place that service on
24
+
the nginx-proxy network, and import that nginx-proxy network to the project. See the below snippet:
0 commit comments