Repository navigation
Expand file tree
/
Copy pathnginx.dev.conf.example
More file actions
69 lines (63 loc) · 2.5 KB
/
Copy pathnginx.dev.conf.example
File metadata and controls
69 lines (63 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
worker_processes 1;
error_log /tmp/codecast-nginx-error.log;
pid /tmp/codecast-nginx.pid;
events {
worker_connections 1024;
}
http {
access_log /tmp/codecast-nginx-access.log;
map $host $backend_port {
local.codecast.sh 3200;
local.1.codecast.sh 3201;
local.2.codecast.sh 3202;
local.3.codecast.sh 3203;
default 3200;
}
server {
listen 80;
server_name local.codecast.sh local.1.codecast.sh local.2.codecast.sh local.3.codecast.sh;
location / {
proxy_pass http://127.0.0.1:$backend_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
}
}
# TLS, for https://local.codecast.sh. The desktop app needs it
# (packages/electron's dev script loads the https origin). Make a locally
# trusted certificate with mkcert (brew install mkcert), as your own user:
#
# mkcert -install
# mkdir -p ~/.config/codecast-dev
# mkcert -cert-file ~/.config/codecast-dev/local.pem \
# -key-file ~/.config/codecast-dev/local-key.pem \
# local.codecast.sh local.1.codecast.sh local.2.codecast.sh local.3.codecast.sh
#
# Then uncomment this block in your nginx.dev.conf, replace /Users/YOU with
# your home directory (nginx does not expand ~), and rerun
# sudo ./setup-hosts.sh to reload.
#
# server {
# listen 443 ssl;
# server_name local.codecast.sh local.1.codecast.sh local.2.codecast.sh local.3.codecast.sh;
# ssl_certificate /Users/YOU/.config/codecast-dev/local.pem;
# ssl_certificate_key /Users/YOU/.config/codecast-dev/local-key.pem;
#
# location / {
# proxy_pass http://127.0.0.1:$backend_port;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_read_timeout 86400;
# }
# }
}