Skip to content

Commit 6f0b72a

Browse files
authored
Remove '$' from the commands and add sudo options
1 parent d48b247 commit 6f0b72a

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

docs/README.md

+23-15
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Also, you will need to make sure you have:
4343
1. Clone this repository **using the option _--recurse-submodules_**:
4444

4545
```bash
46-
$ git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-automation.git proxy
46+
git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-automation.git proxy
4747
```
4848

4949
> Make sure you use the option '--recurse-submodules' once we use an external module in this project, please check
@@ -54,8 +54,8 @@ $ git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-autom
5454
2. 🚀 Run the script 'fresh_start.sh'
5555

5656
```bash
57-
$ cd proxy/bin
58-
$ ./fresh-start.sh
57+
cd proxy/bin
58+
./fresh-start.sh
5959
```
6060
This script will walk you through all config process.
6161

@@ -81,21 +81,21 @@ the default please update the option *'NETWORK'* in the examples below before ru
8181

8282
- Simple site without Let's Encrypt certificate
8383
```bash
84-
$ docker run -d -e VIRTUAL_HOST=your.domain.com \
85-
--network=proxy \
86-
--name my_app \
87-
httpd:alpine
84+
docker run -d -e VIRTUAL_HOST=your.domain.com \
85+
--network=proxy \
86+
--name my_app \
87+
httpd:alpine
8888
```
8989

9090
- To have SSL in your web/app you must add the option `-e LETSENCRYPT_HOST=your.domain.com`, as follow:
9191

9292
```bash
93-
$ docker run -d -e VIRTUAL_HOST=your.domain.com \
94-
-e LETSENCRYPT_HOST=your.domain.com \
95-
-e LETSENCRYPT_EMAIL=your.email@your.domain.com \
96-
--network=proxy \
97-
--name my_app \
98-
httpd:alpine
93+
docker run -d -e VIRTUAL_HOST=your.domain.com \
94+
-e LETSENCRYPT_HOST=your.domain.com \
95+
-e LETSENCRYPT_EMAIL=your.email@your.domain.com \
96+
--network=proxy \
97+
--name my_app \
98+
httpd:alpine
9999
```
100100

101101
> You don´t need to open port *443* in your container, the certificate validation is managed by the web proxy
@@ -112,8 +112,8 @@ In order to be able to secure your virtual host with basic authentication, you m
112112
within `${NGINX_FILES_PATH}/htpasswd/${VIRTUAL_HOST}` via:
113113

114114
```bash
115-
$ sudo sh -c "echo -n '[username]:' >> ${NGINX_FILES_PATH}/htpasswd/${VIRTUAL_HOST}"
116-
$ sudo sh -c "openssl passwd -apr1 >> ${NGINX_FILES_PATH}/htpasswd/${VIRTUAL_HOST}"
115+
sudo sh -c "echo -n '[username]:' >> ${NGINX_FILES_PATH}/htpasswd/${VIRTUAL_HOST}"
116+
sudo sh -c "openssl passwd -apr1 >> ${NGINX_FILES_PATH}/htpasswd/${VIRTUAL_HOST}"
117117
```
118118

119119
> Please replace the `${NGINX_FILES_PATH}` with real path to information, replace `[username]` with your username and `${VIRTUAL_HOST}` with your host's domain. You will be prompted for a password.
@@ -159,6 +159,14 @@ docker exec -it ${NGINX_WEB} nginx -s reload
159159

160160
Where *${NGINX_WEB}* is your proxy container name, which in the original `.env` file is set as *nginx-web*.
161161

162+
5. **sudo** options
163+
164+
If you need to save the nginx-proxy data files in a folder which the user running 'fresh-start.sh' script does not have access, you might accomplish that using _sudo_. In order to allow the script to run some commands with _sudo_ you need to set _true_ to the variable ['ALLOW_RUN_WITH_SUDO'](https://github.com/evertramos/nginx-proxy-automation/blob/d48b2477ed28cbda37738046079e35df219ba3e9/.env.sample#L20) at '.env.sample' file **before** running fresh-start.sh script, as of:
165+
166+
```bash
167+
# Allow run commands with sudo if needed
168+
ALLOW_RUN_WITH_SUDO=true
169+
```
162170

163171
## Testing nginx-proxy
164172

0 commit comments

Comments
 (0)