Dan K
2019-08-06 308b57b7a031c2dc7575e87eefda67c1852c6f06
commit | author | age
f6dd9c 1 # For more information on configuration, see:
SU 2 #   * Official English Documentation: http://nginx.org/en/docs/
3 #   * Official Russian Documentation: http://nginx.org/ru/docs/
4
5 env BACKEND_HOST;
6
7 worker_processes auto;
8 error_log stderr;
9 pid /run/nginx.pid;
10
11 # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
12 include /usr/share/nginx/modules/*.conf;
13
14 events {
15     worker_connections 1024;
16 }
17
18 http {
19     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
20                       '$status $body_bytes_sent "$http_referer" '
21                       '"$http_user_agent" "$http_x_forwarded_for"';
22
23     sendfile            on;
24     tcp_nopush          on;
25     tcp_nodelay         on;
26     keepalive_timeout   65;
27     types_hash_max_size 2048;
28
29     include             /etc/nginx/mime.types;
30     default_type        application/octet-stream;
31
32     # Load modular configuration files from the /etc/nginx/conf.d directory.
33     # See http://nginx.org/en/docs/ngx_core_module.html#include
34     # for more information.
35     include /etc/nginx/conf.d/*.conf;
36
37     perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }';
38
39     server {
40         listen       8080 default_server;
41         listen       [::]:8080 default_server;
42         server_name  _;
43         root         /usr/share/nginx/html;
44
45         # Load configuration files for the default server block.
46         include /etc/nginx/default.d/*.conf;
47
48         sub_filter_types application/javascript;
49         sub_filter '_BACKEND_' $backend;
50         sub_filter_once off;
51
52         location / {
53         }
54
55         error_page 404 /404.html;
56             location = /40x.html {
57         }
58
59         error_page 500 502 503 504 /50x.html;
60             location = /50x.html {
61         }
62     }
63
64 }