Skip to content

Commit 8856901

Browse files
committed
Rewrite info about nginx on CentOS
1 parent 9d4aaa9 commit 8856901

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

web-server/nginx/README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1-
# CentOS related Nginx notes
1+
## CentOS related Nginx notes
22

3-
* If nginx is installed through the package manager, adjust sites in `/etc/nginx/conf.d/` instead of `/etc/nginx/sites-available/`.
3+
### Different conf directories
44

5-
* Replace the default `nginx` user with `git` and group `root` in `/etc/nginx/nginx.conf`:
5+
If nginx is installed through the package manager, adjust sites in `/etc/nginx/conf.d/`
6+
instead of `/etc/nginx/sites-available/` or create those directories and tell `nginx`
7+
to monitor them:
68

7-
#user nginx;
8-
user git root;
9+
sudo mkdir /etc/nginx/sites-{available,enabled}
910

10-
or add `nginx` user to `git` group.
11+
Then edit `/etc/nginx/nginx.conf` and replace `include /etc/nginx/conf.d/*.conf;`
12+
with `/etc/nginx/sites-enabled/*;`
1113

12-
sudo usermod -a -G git nginx
13-
sudo chmod g+rx /home/git/
14+
### Give nginx access to git group
15+
16+
In order for GitLab to display properly you have to make either one of the changes
17+
below. The first one is recommended.
18+
19+
Add `nginx` user to `git` group:
20+
21+
sudo usermod -a -G git nginx
22+
sudo chmod g+rx /home/git/
23+
24+
or replace the default `nginx` user with `git` and group `root` in `/etc/nginx/nginx.conf`:
25+
26+
#user nginx;
27+
user git root;

0 commit comments

Comments
 (0)