Docker Compose file checkin for tr069-adapter
[oam/tr069-adapter.git] / nginx / config / nginx.conf
1 # ============LICENSE_START========================================================================
2 # O-RAN-SC : tr-069-adapter
3 # =================================================================================================
4 # Copyright (C) 2020 CommScope Inc Intellectual Property.
5 # =================================================================================================
6 # This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
7 # Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
8 # may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13 # either express or implied. See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ===============LICENSE_END=======================================================================
16 worker_processes auto;
17  
18 events { worker_connections 1024; }
19  
20 http {
21  
22     sendfile on;
23     ssl_password_file /etc/nginx/ssl/tr069adapterCertPassPhrase;
24 #
25 # This Section is TR069Adapter for SSL Termination
26 #
27     server {
28         listen 1111 tr069adapterComm;
29         server_name         netconfServerIP;
30         ssl_certificate     /etc/nginx/ssl/tr069adapterSSLCert;
31         ssl_certificate_key /etc/nginx/ssl/tr069adapterSSLKey;
32
33         ssl_client_certificate /etc/nginx/ssl/tr069adapterSSLClientTrustCRT;
34         ssl_verify_client on;
35
36         location /viewAll {
37             proxy_pass         http://netconfServerIP:8089;
38         }
39
40         location /importFactory {
41             proxy_pass         http://netconfServerIP:8089;
42         }
43
44         location /importConfig {
45             proxy_pass         http://netconfServerIP:9000;
46         }
47
48         location /getConfig {
49             proxy_pass         http://netconfServerIP:9000;
50         }
51
52         location /netConfServerManagerService/listServers {
53             proxy_pass         http://netconfServerIP:8181;
54         }
55
56         location /CPEMgmt/acs {
57             proxy_pass         http://netconfServerIP:9977;
58             proxy_redirect     off;
59             proxy_set_header   Host $host;
60             proxy_set_header   X-Real-IP $remote_addr;
61             proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
62             proxy_set_header   X-Forwarded-Host $server_name;
63         }
64     }
65
66 #
67 # This Section is for Fault VES Collector
68 #
69     server {
70         listen 2222;
71         resolver faultvesCollectorDNSServer;
72         server_name netconfServerIP;
73
74         location / {
75             proxy_pass                     https://faultvesCollectorHost:faultvesCollectorPort$request_uri;
76             proxy_ssl_certificate          /etc/nginx/ssl/faultvesCollectorSSLCert;
77             proxy_ssl_certificate_key      /etc/nginx/ssl/faultvesCollectorSSLKey;
78             proxy_ssl_password_file        /etc/nginx/ssl/tr069adapterCertPassPhrase;
79             proxy_ssl_session_reuse        on;
80
81             proxy_ssl_trusted_certificate  /etc/nginx/ssl/faultvesCollectorTrustCRT;
82             proxy_ssl_verify               on;
83             proxy_ssl_verify_depth         2;
84             
85             proxy_set_header Authorization "Basic faultvesCollectorBasicAuthUserPassEncrypt";
86         }
87     }
88
89 #
90 # This Section is for PNF Reg VES Collector
91 #
92
93     server {
94         listen 3333;
95         resolver pnfregvesCollectorDNSServer;
96         server_name netconfServerIP;
97
98         location / {
99             proxy_pass                     https://pnfregvesCollectorHost:pnfregvesCollectorPort$request_uri;
100             proxy_ssl_certificate          /etc/nginx/ssl/pnfregvesCollectorSSLCert;
101             proxy_ssl_certificate_key      /etc/nginx/ssl/pnfregvesCollectorSSLKey;
102             proxy_ssl_password_file        /etc/nginx/ssl/tr069adapterCertPassPhrase;
103             proxy_ssl_session_reuse        on;
104    
105             proxy_ssl_trusted_certificate  /etc/nginx/ssl/pnfregvesCollectorTrustCRT;
106             proxy_ssl_verify               on;
107             proxy_ssl_verify_depth         2;
108
109             proxy_set_header Authorization "Basic pnfregvesCollectorBasicAuthUserPassEncrypt";
110         }
111     }
112 }