Use non-root user in Dockerfile for a1-interface
[sim/a1-interface.git] / near-rt-ric-simulator / nginx.conf
1 # user www-data;
2 worker_processes auto;
3 pid /run/nginx.pid;
4 include /etc/nginx/modules-enabled/*.conf;
5
6 env ALLOW_HTTP;
7
8 events {
9     worker_connections 768;
10     # multi_accept on;
11 }
12
13 http {
14
15     ##
16     # Basic Settings
17     ##
18
19     sendfile on;
20     tcp_nopush on;
21     tcp_nodelay on;
22     keepalive_timeout 65;
23     types_hash_max_size 2048;
24     # server_tokens off;
25
26     # server_names_hash_bucket_size 64;
27     # server_name_in_redirect off;
28
29     include /etc/nginx/mime.types;
30     default_type application/octet-stream;
31
32     perl_set $allow_http 'sub { return $ENV{"ALLOW_HTTP"}; }';
33
34     server { # simple reverse-proxy
35         listen      8085;
36         listen      [::]:8085;
37         server_name  localhost;
38         if ($allow_http != true) {
39             return 444;
40         }
41
42         # serve dynamic requests
43         location / {
44             proxy_set_header   Host                 $host;
45             proxy_set_header   X-Real-IP            $remote_addr;
46             proxy_set_header   X-Forwarded-For      $proxy_add_x_forwarded_for;
47             proxy_pass      http://localhost:2222;
48         }
49     }
50
51     server { # simple reverse-proxy
52         listen      8185 ssl;
53         listen      [::]:8185 ssl;
54         server_name  localhost;
55         ssl_certificate     /usr/src/app/cert/cert.crt;
56         ssl_certificate_key /usr/src/app/cert/key.crt;
57         ssl_password_file   /usr/src/app/cert/pass;
58
59         # serve dynamic requests
60         location / {
61             proxy_set_header   Host                 $host;
62             proxy_set_header   X-Real-IP            $remote_addr;
63             proxy_set_header   X-Forwarded-For      $proxy_add_x_forwarded_for;
64             proxy_pass      http://localhost:2222;
65         }
66     }
67     ##
68     # SSL Settings
69     ##
70
71     ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
72     ssl_prefer_server_ciphers on;
73
74     ##
75     # Logging Settings
76     ##
77
78     access_log /var/log/nginx/access.log;
79     error_log /var/log/nginx/error.log;
80
81     ##
82     # Gzip Settings
83     ##
84
85     gzip on;
86
87     # gzip_vary on;
88     # gzip_proxied any;
89     # gzip_comp_level 6;
90     # gzip_buffers 16 8k;
91     # gzip_http_version 1.1;
92     # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
93
94     ##
95     # Virtual Host Configs
96     ##
97
98     include /etc/nginx/conf.d/*.conf;
99     include /etc/nginx/sites-enabled/*;
100 }
101
102
103 #mail {
104 #       # See sample authentication script at:
105 #       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
106 #
107 #       # auth_http localhost/auth.php;
108 #       # pop3_capabilities "TOP" "USER";
109 #       # imap_capabilities "IMAP4rev1" "UIDPLUS";
110 #
111 #       server {
112 #               listen     localhost:110;
113 #               protocol   pop3;
114 #               proxy      on;
115 #       }
116 #
117 #       server {
118 #               listen     localhost:143;
119 #               protocol   imap;
120 #               proxy      on;
121 #       }
122 #}