-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx.conf
70 lines (60 loc) · 2.04 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
64
65
66
67
68
69
70
events {}
http {
# HTTP Server Block
server {
listen 80;
# Allow requests from any domain/IP address
# server_name _;
#------------------------------------
# # Enable this block when you want to use https
# location / {
# return 301 https://$host$request_uri;
# }
#------------------------------------
#Disable this block when you don't want to use http
# Serve Angular (PWA) Requests
location / {
proxy_pass http://climsoft_pwa:80;
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 API Requests to NestJS
location /api/ {
proxy_pass http://climsoft_api:3000/;
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 Origin $http_origin; # Forward the Origin header. TODO this is not forwarded to NestJS yet, so investigate why.
}
#------------------------------------
}
#------------------------------------
# Enable this block when you want to use https
# HTTPS Server Block
# server {
# listen 443 ssl;
# server_name localhost;
# # SSL Certificate Files
# #ssl_certificate /etc/nginx/certs/fullchain.pem;
# #ssl_certificate_key /etc/nginx/certs/privkey.pem;
# # SSL Protocols and Ciphers
# #ssl_protocols TLSv1.2 TLSv1.3;
# #ssl_ciphers HIGH:!aNULL:!MD5;
# # Serve Angular (PWA) Requests
# location / {
# proxy_pass http://climsoft_pwa:80;
# 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 API Requests to NestJS
# location /api/ {
# proxy_pass http://climsoft_api:3000/;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# }
# }
#------------------------------------
}