Razique Mahroua
2019-11-30 429728d0a08fd274ab59b85de60b938efa4d2012
commit | author | age
4f5bed 1 # For more information on configuration, see:
RM 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/default.d/*.conf;
345c6a 36
RM 37     # Comment the following to disable the SSL configuration
4f5bed 38     include /etc/nginx/conf.d/*.conf;
RM 39
40     perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }';
41
42     server {
43         listen       8080 default_server;
44         listen       [::]:8080 default_server;
45         server_name  _;
46         root         /usr/share/nginx/html;
47
48         # Load configuration files for the default server block.
49         # include /etc/nginx/conf.d/*.conf;
50
51         sub_filter_types application/javascript;
52         sub_filter '_BACKEND_' $backend;
53         sub_filter_once off;
54
55         location / {
56         }
57
58         error_page 404 /404.html;
59             location = /40x.html {
60         }
61
62         error_page 500 502 503 504 /50x.html;
63             location = /50x.html {
64         }
429728 65         # Comment the following lines to disable SSL support
RM 66         error_page 497 https://$host:8443$request_uri;
67         return 301 https://$host:8443$request_uri;
4f5bed 68     }
RM 69
70 }