-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathexample-nginx-vhost
61 lines (48 loc) · 1.82 KB
/
example-nginx-vhost
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
upstream gui {
server 0.0.0.0:3030;
keepalive 64;
}
upstream hApi {
server 127.0.0.1:3000;
keepalive 64;
}
server {
listen 80;
server_name localhost;
error_page 400 404 500 502 503 504 /50x.html;
location /50x.html {
internal;
root /usr/share/nginx/www;
}
# Serve frontend files
location ~ ^/(landingPage/|images/|img/|javascript/|js/|css/|stylesheets/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico|home/|html|xml|pdf) {
root /va/rwww/mediaScanner/public;
access_log off;
expires 0m;
}
# Open up the api. This location limiting to specifc routes
location ~ ^/(api) {
proxy_redirect off;
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_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_pass http://hApi;
proxy_intercept_errors off;
}
location / {
proxy_redirect off;
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_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_pass http://gui;
proxy_intercept_errors off;
}
}