Ticket #565: nginx.conf

File nginx.conf, 3.4 KB (added by pavel stano, 12 years ago)

example config

Line 
1
2#user nobody;
3worker_processes 1;
4
5#error_log logs/error.log;
6#error_log logs/error.log notice;
7#error_log logs/error.log info;
8
9#pid logs/nginx.pid;
10
11
12events {
13 worker_connections 1024;
14}
15
16
17http {
18 include mime.types;
19 default_type application/octet-stream;
20
21 limit_conn_zone $binary_remote_addr zone=connections:10m;
22
23 #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
24 # '$status $body_bytes_sent "$http_referer" '
25 # '"$http_user_agent" "$http_x_forwarded_for"';
26
27 #access_log logs/access.log main;
28
29 sendfile on;
30 #tcp_nopush on;
31
32 #keepalive_timeout 0;
33 keepalive_timeout 65;
34
35 #gzip on;
36
37 server {
38 listen 80;
39 server_name localhost;
40
41 #charset koi8-r;
42
43 #access_log logs/host.access.log main;
44
45
46 limit_conn connections 10;
47
48 location / {
49 # root html;
50 # index index.html index.htm;
51
52 proxy_set_header Host www.sme.sk;
53 proxy_set_header X-Real-IP $remote_addr;
54 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
55 proxy_set_header X-Forwarded-Proto $scheme;
56 proxy_set_header Connection "";
57 proxy_pass http://xxx;
58
59 }
60
61 #error_page 404 /404.html;
62
63 # redirect server error pages to the static page /50x.html
64 #
65 error_page 500 502 503 504 /50x.html;
66 location = /50x.html {
67 root html;
68 }
69
70 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
71 #
72 #location ~ \.php$ {
73 # proxy_pass http://127.0.0.1;
74 #}
75
76 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
77 #
78 #location ~ \.php$ {
79 # root html;
80 # fastcgi_pass 127.0.0.1:9000;
81 # fastcgi_index index.php;
82 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
83 # include fastcgi_params;
84 #}
85
86 # deny access to .htaccess files, if Apache's document root
87 # concurs with nginx's one
88 #
89 #location ~ /\.ht {
90 # deny all;
91 #}
92 }
93
94
95 # another virtual host using mix of IP-, name-, and port-based configuration
96 #
97 #server {
98 # listen 8000;
99 # listen somename:8080;
100 # server_name somename alias another.alias;
101
102 # location / {
103 # root html;
104 # index index.html index.htm;
105 # }
106 #}
107
108
109 # HTTPS server
110 #
111 server {
112 listen 443 ssl spdy;
113 server_name localhost;
114
115 ssl_certificate server.crt;
116 ssl_certificate_key server.key;
117
118 ssl_session_cache shared:SSL:1m;
119 ssl_session_timeout 5m;
120
121 ssl_ciphers HIGH:!aNULL:!MD5;
122 ssl_prefer_server_ciphers on;
123
124 limit_conn connections 10;
125
126 location / {
127 #root html;
128 #index index.html index.htm;
129
130 proxy_set_header Host www.sme.sk;
131 proxy_set_header X-Real-IP $remote_addr;
132 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
133 proxy_set_header X-Forwarded-Proto $scheme;
134 proxy_set_header Connection "";
135 proxy_pass http://xxx;
136
137# proxy_cache cacheone;
138# proxy_cache_bypass $nocache;
139
140 }
141 }
142
143upstream xxx {
144 server www.sme.sk:80;
145}
146
147
148}
149
150