Menu

[21d594]: / example-projects / clojure-web-example / conf / nginx.conf  Maximize  Restore  History

Download this file

96 lines (66 with data), 3.1 kB

 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
## Determines whether nginx should become a daemon and default is on.
daemon on;
## If master_process is off, there will be only one nginx worker running. Only use it for debug propose.
## Default is on.
master_process on;
## Define which OS user & group nginx worker processes will run as.
user nginx nginx;
## Defines the number of worker processes every of which will be embedded one JVM instance.
## When auto is specified the number of worker processes will be the number of CPU hardware threads
worker_processes auto;
error_log logs/error.log;
events {
## Defines the number of connections per worker processes.
## Note that this number includes all connections (e.g. connections with proxied servers, among others),
## not only connections with clients.
worker_connections 1024;
}
http {
## include file mime.types which defines file type to mime type mappings
include mime.types;
## Default mime type for unknown file type
default_type application/octet-stream;
## access log, more details can be found from http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
## when do performance tests try to turn off it, viz. use `access_log off;` instead.
access_log logs/access.log combined;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
## Enable gzip, default is off
#gzip on;
## Defines the path of JVM, when auto is used nginx-clojure will detect this by itself.
jvm_path auto;
## Define class path. When '/*' is used after a directory path all jar files and
##sub-directories will be used as the jvm classpath
jvm_classpath "libs/*";
jvm_options '-DMY_PNO=#{pno}';
### jvm heap memory
#jvm_options "-Xms1024m";
#jvm_options "-Xmx1024m";
## Threads number for request handler thread pool on jvm, default is 0 which means disable
## thread pool mode. Check more details from section 2.4 in http://nginx-clojure.github.io/configuration.html
#jvm_workers 8;
## shared map used by sub/pub API such as build-topic!, sub! and pub!.
shared_map PubSubTopic tinymap?space=1m&entries=256;
## for shared map based ring session store
shared_map mySessionStore tinymap?space=1m&entries=256;
jvm_handler_type 'clojure';
jvm_init_handler_name 'clojure-web-example.handler/jvm-init-handler';
server {
listen 80;
server_name localhost;
location / {
content_handler_name 'clojure-web-example.handler/app';
}
## static js files although our ring hander can handle static resources
## but we overwrite it here for better performance
location /js {
alias public/js;
}
## redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.