|
1 | | -server { |
2 | | - listen 80; |
3 | | - server_name localhost; |
4 | | - index index.php index.html index.htm; |
5 | | - root /www/testweb/project/ac; |
6 | | - #charset koi8-r; |
7 | | - #access_log /var/log/nginx/host.access.log main; |
8 | | - |
9 | | - location / { |
10 | | -try_files $uri $uri/ /index.php?$query_string; |
11 | | -index index.php index.html index.htm; |
12 | | - # root /usr/share/nginx/html; |
| 1 | +# user nobody; |
| 2 | + |
| 3 | +worker_processes auto; |
| 4 | + |
| 5 | +error_log /var/log/nginx/error.log crit; |
| 6 | +# error_log logs/error.log; |
| 7 | +# error_log logs/error.log notice; |
| 8 | +# error_log logs/error.log info; |
| 9 | + |
| 10 | +# pid logs/nginx.pid; |
| 11 | + |
| 12 | +events { |
| 13 | + use epoll; |
| 14 | + worker_connections 51200; |
| 15 | + multi_accept on; |
| 16 | +} |
| 17 | + |
| 18 | +http { |
| 19 | + include mime.types; |
| 20 | + default_type application/octet-stream; |
| 21 | + |
| 22 | + # log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
| 23 | + # '$status $body_bytes_sent "$http_referer" ' |
| 24 | + # '"$http_user_agent" "$http_x_forwarded_for"'; |
| 25 | + |
| 26 | + # access_log logs/access.log main; |
| 27 | + |
| 28 | + sendfile on; |
| 29 | + # tcp_nopush on; |
| 30 | + |
| 31 | + # keepalive_timeout 0; |
| 32 | + keepalive_timeout 60; |
| 33 | + |
| 34 | + gzip on; |
| 35 | + gzip_min_length 1k; |
| 36 | + gzip_buffers 4 16k; |
| 37 | + gzip_http_version 1.1; |
| 38 | + gzip_comp_level 2; |
| 39 | + gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss; |
| 40 | + gzip_vary on; |
| 41 | + gzip_proxied expired no-cache no-store private auth; |
| 42 | + |
| 43 | + server { |
| 44 | + listen 80; |
| 45 | + server_name localhost; |
| 46 | + index index.php index.html index.htm; |
13 | 47 | root /www/testweb/project/ac; |
14 | | - } |
| 48 | + # charset koi8-r; |
| 49 | + # access_log /var/log/nginx/host.access.log main; |
15 | 50 |
|
16 | | - #error_page 404 /404.html; |
| 51 | + location / { |
| 52 | + try_files $uri $uri/ /index.php?$query_string; |
| 53 | + index index.php index.html index.htm; |
| 54 | + # root /usr/share/nginx/html; |
| 55 | + root /www/testweb/project/ac; |
| 56 | + } |
17 | 57 |
|
18 | | - # redirect server error pages to the static page /50x.html |
19 | | - # |
20 | | - error_page 500 502 503 504 /50x.html; |
21 | | - location = /50x.html { |
22 | | - root /www; |
23 | | - } |
| 58 | + # error_page 404 /404.html; |
| 59 | + # redirect server error pages to the static page /50x.html |
| 60 | + error_page 500 502 503 504 /50x.html; |
| 61 | + location = /50x.html { |
| 62 | + root /www; |
| 63 | + } |
| 64 | + |
| 65 | + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 |
| 66 | + # |
| 67 | + # location ~ \.php$ { |
| 68 | + # proxy_pass http://127.0.0.1; |
| 69 | + # } |
| 70 | + |
| 71 | + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
| 72 | + location ~ [^/]\.php(/|$) { |
| 73 | + fastcgi_pass 172.17.0.2:9000; |
| 74 | + fastcgi_index index.php; |
| 75 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 76 | + include fastcgi_params; |
| 77 | + } |
24 | 78 |
|
25 | | - # proxy the PHP scripts to Apache listening on 127.0.0.1:80 |
26 | | - # |
27 | | - #location ~ \.php$ { |
28 | | - # proxy_pass http://127.0.0.1; |
29 | | - #} |
30 | | - |
31 | | - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
32 | | - |
33 | | - location ~ [^/]\.php(/|$) { |
34 | | - fastcgi_pass 172.17.0.2:9000; |
35 | | - fastcgi_index index.php; |
36 | | - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
37 | | - include fastcgi_params; |
| 79 | + # deny access to .htaccess files, if Apache's document root |
| 80 | + # concurs with nginx's one |
| 81 | + # |
| 82 | + # location ~ /\.ht { |
| 83 | + # deny all; |
| 84 | + # } |
38 | 85 | } |
| 86 | + # HTTPS server |
| 87 | + # server { |
| 88 | + # listen 443 ssl; |
| 89 | + # server_name localhost; |
39 | 90 |
|
40 | | - # deny access to .htaccess files, if Apache's document root |
41 | | - # concurs with nginx's one |
42 | | - # |
43 | | - #location ~ /\.ht { |
44 | | - # deny all; |
45 | | - #} |
| 91 | + # ssl_certificate cert.pem; |
| 92 | + # ssl_certificate_key cert.key; |
| 93 | + |
| 94 | + # ssl_session_cache shared:SSL:1m; |
| 95 | + # ssl_session_timeout 5m; |
| 96 | + |
| 97 | + # ssl_ciphers HIGH:!aNULL:!MD5; |
| 98 | + # ssl_prefer_server_ciphers on; |
| 99 | + |
| 100 | + # location / { |
| 101 | + # root html; |
| 102 | + # index index.html index.htm; |
| 103 | + # } |
| 104 | + # } |
| 105 | + # include /etc/nginx/conf.d/vhost/*.conf; |
46 | 106 | } |
47 | | -# include /etc/nginx/conf.d/vhost/*.conf; |
| 107 | + |
| 108 | + |
48 | 109 |
|
0 commit comments