-
Notifications
You must be signed in to change notification settings - Fork 8
/
nginx.conf
63 lines (60 loc) · 2.28 KB
/
nginx.conf
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
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
upstream ares.codeobia.com {
server localhost:8080;
}
upstream api.codeobia.com {
server localhost:3000;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
index index.html index.htm index.nginx-debian.html;
server_name ares.codeobia.com;
location ~ ^/api/exports/(.*)$ {
alias /home/ubuntu/AReS/app/temp-exports/;
add_header Content-disposition "attachment";
gzip_static on;
expires max;
add_header Cache-Control public;
}
location ~ ^/api/(.*)$ {
proxy_set_header XForwardedFor $proxy_add_x_forwarded_for;
proxy_pass http://api.codeobia.com/$1;
proxy_set_header Host $host;
proxy_set_header Referer $http_referer;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ ^/explorer(.*)$ {
proxy_set_header XForwardedFor $proxy_add_x_forwarded_for;
proxy_pass http://ares.codeobia.com/$1$is_args$args;
proxy_set_header Host $host;
proxy_set_header Referer $http_referer;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ares.codeobia.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ares.codeobia.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}