91c582345be8baff6e79c72289bf188150a9a88f
Nginx MAC Setup.md
... | ... | @@ -0,0 +1,36 @@ |
1 | + |
|
2 | +Install homebrew |
|
3 | + |
|
4 | +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
|
5 | + |
|
6 | +brew install nginx |
|
7 | + |
|
8 | +``` |
|
9 | +server { |
|
10 | + listen 80; |
|
11 | + listen [::]:80; |
|
12 | + server_name stubbornspace.com; |
|
13 | + |
|
14 | + #location / { |
|
15 | + # root /usr/share/nginx/html; |
|
16 | + # index index.html index.htm; |
|
17 | + #} |
|
18 | + |
|
19 | + location / { |
|
20 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
21 | + proxy_set_header X-Forwarded-Proto $scheme; |
|
22 | + proxy_set_header X-Real-IP $remote_addr; |
|
23 | + proxy_set_header Host $http_host; |
|
24 | + proxy_pass http://127.0.0.1:4567; |
|
25 | + |
|
26 | + auth_basic "No no no, you forgot the majic word"; |
|
27 | + auth_basic_user_file /etc/nginx/.htpasswd; |
|
28 | + } |
|
29 | + client_max_body_size 10m; |
|
30 | + |
|
31 | + error_page 500 502 503 504 /50x.html; |
|
32 | + location = /50x.html { |
|
33 | + root /usr/share/nginx/html; |
|
34 | + } |
|
35 | +} |
|
36 | +``` |
|
... | ... | \ No newline at end of file |