-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnginx.dev.conf
More file actions
60 lines (52 loc) · 1.75 KB
/
nginx.dev.conf
File metadata and controls
60 lines (52 loc) · 1.75 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
upstream django_app {
server django:8000;
}
upstream vue_app {
server vue:8080;
}
server {
listen 80;
server_name localhost;
server_tokens off;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name localhost;
server_tokens off;
# Development cert's: (use stage cert's)
# Certificate is set to expire 1 year after creation, if a new
# one is required, generate it with:
# $ env/staged-letsencrypt/live/localhost/generate-certs.sh
ssl_certificate /etc/letsencrypt/live/localhost/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/localhost/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://django_app;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
# Vue dev server:
# Configuration is based on the following:
# ref: https://medium.com/homullus/vuejs-dev-serve-with-reverse-proxy-cdc3c9756aeb
# ref: https://github.com/markomitranic/Kaputt-app/blob/master/Docker/nginx/conf/kaputt-dev.conf
location /app/ {
proxy_pass http://vue_app;
proxy_set_header Host localhost;
proxy_set_header Origin localhost;
proxy_hide_header Access-Control-Allow-Origin;
}
location /sockjs-node/ {
proxy_pass http://vue_app;
proxy_set_header Host localhost;
proxy_set_header Origin localhost;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_hide_header Access-Control-Allow-Origin;
}
}